cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407: Using DFuse or STLINK to talk directly to the bootloader, bypassing JTAG

michaelfortner9
Associate II
Posted on June 12, 2013 at 21:33

Hello,

I have a customer that is using the following Omilex STM32F407 based board for development:

https://www.olimex.com/Products/ARM/ST/STM32-P407/

They selected this board because the STM32F4 discovery boards we provided did not implement an ethernet port/PHY.

They are trying to get STLINK/DFuse working with the board on a PC that is running Windows 7 (64-bit) and connecting to the board using USB, but have run into trouble because they want to talk directly to the bootloader, not a JTAG processor such as the one on the Discovery Board.

-STLINK: They receive a message that states no STLINK is found. Note that STLINK appears within Device Manager and they have confirmed it works with a Discovery Board (uses the JTAG processor)

-DFuse: DFuse finds the device, but it crashes immediately if the customer tries to upload anything to the device

So essentially they are trying to talk directly to the STM32F407 part with no jtag device involvement (i.e. change the boot mode from user flash to system memory and use the built-in USB boot loader).

Again, the customer knows it is partially working because he can  see the device in Windows Device Manager.

So at this point he has asked me to confirm that STLINK has the capability of talking to the built in boot loader. If not, is there another tool he needs to consider which will allow him to talk directly to the bootloader and not a separate Jtag processor on the board (USB bootloader?).

Thanks in advance for any guidance you can provide.

Mike

9 REPLIES 9
Posted on June 12, 2013 at 21:56

You're mixing up some of the term/features here.

The ST-Link (STM32F103 part on the board) on the STM32F4-Discovery board does not use JTAG, but rather SWD, and it does not talk to the System Loader on the STM32F407. The JTAG/SWD is a chip level access method, the System Loader is a software level access method, they are distinctly different.

For DfuSe you'd need to connect to the OTHER USB connector (CN5 micro AB), which is physically connected to the STM32F407.

For DfuSe to start you'd need to either pull BOOT0 high and reset, or enter the System Loader via a call.

USART1 on PA9/10 is not viable on the STM32F4-Discovery board, but USART3 on PB10/11 could be used to talk to the System Loader via the serial port.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
michaelfortner9
Associate II
Posted on June 13, 2013 at 14:48

Thanks Clive.  I will share this information with the customer and hopefully it provides some clarity to what they are trying to accomplish by accessing the bootloader directly.

michaelfortner9
Associate II
Posted on June 13, 2013 at 20:38

Clive,

Thanks again for the feedback/guidance.

I shared this with the customer and it appears that he has since figured much of this out.

Essentially, if the engineer pulls the jumpers off the Discovery Board he can wire the SWD from the Discovery Board to the 3rd Party board and program it that way (seems to be working); it also appears that the USB facilities in Windows 7 report the correct information as well (STM32 Bootloader rather than ST-Link).

He went on to say that he also now realizes that the USB bootloader uses a differnt USB port (i.e. it uses the one directly tied to the STM32F4), rather than being routed through the ST-LINK/SWD interface.

He still has one remaining question:

When boot 0,1 is configured on the STM32F407 such that its booting to the system memory, he understands that this should make the USB onchip boot-loader active. Based on the fact that the Windows device manager correctly finds and initialize drivers for a STM32 Bootloader, he is assuming that all of this is working per above.

What software tool should be used to talk to this interface?

Again, he has tried the tools in the DeFuse package (DfuSe Demo (V3.0.3) and DFU Tester (V3.0.1) 

He said that maybe one time in three the DFU Tester will work, but the DefuSe demo always crashes.

Any idea as to what he may be doing wrong?

Mike

Thanks Clive.  I will share this information with the customer and hopefully it provides some clarity to what they are trying to accomplish by accessing the bootloader directly.

Posted on June 13, 2013 at 20:54

I've used DfuSe Demo, care has to be taken to install the appropriate 32 or 64-bit version of the drivers/tools

Does the board show up in device manager as ''STM Device in DFU mode''?

Just BOOT(0) needs to pulled high on the STM32F4-Discovery board.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
billr1
Associate II
Posted on June 14, 2013 at 03:35

I'm a little confused about this thread. the original post said the customer had an Olimex P407 and wanted to use DeFuse via USB. The rest of the messages seemed to refer to the STM Discovery board.

I have a Olimex H407 and have successfully programmed it via the DeFuse demo software. The requirements are:

    1) add a jumper or 0 ohm resistor to R153

    2) place the B0 jumper in the B0_1 position

    3) power cycle the P407

    4) connect the USB-Host connector on the P407 to the PC (you will need a USB-A to USB-A cable)

At this point, the DeFuse driver should detect the board and the software will work. After programming, don't forget to move the B0 jumper back to the B0_0 position.

Posted on June 14, 2013 at 05:35

I and the OP don't have the Olimex board, only his customer, and now you, but we do have STM32F4-Discovery boards, as do others who might have been using DfuSe successfully.

A number of things were asked which needed to be unraveled, and restated with clarity.

I'm starting on the premise that the first step is showing that something known to work other place does indeed do so correctly here, having proven it does we can move to the next step and introduce some unknowns.

Your post confirms that DfuSe works on the Olimex board.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
michaelfortner9
Associate II
Posted on June 14, 2013 at 05:43

I confirmed with the customer that it shows up within Device Manger as ''STM Device in DFU mode''

michaelfortner9
Associate II
Posted on June 14, 2013 at 05:45

Thanks for the guidance Randall.  I will share this feedback with them as well.

billr1
Associate II
Posted on June 15, 2013 at 16:39

You're welcome, Michael. Let us know how it goes with the customer.

  -Bill