cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader by USART not working on my STM32L031C6

GFern
Associate II

I tried to program a STM32L031C6T MCU using bootloader through USART2. I use STMFlashLoader application and Cisco USB to RJ45 (p8) cable. This cable uses a FT231X chip and I have it´s driver installed.

0690X000006DBIDQA4.jpg

My problem is that the connection it´s working, it says: "unrecognized device... please reset your device and try again".

0690X000006DBIIQA4.png

To enter in bootloader mode I need to put "1" on BOOT0 pin and nBOOT1 bit must be also "1". By default nBOOT1 is "1" so I only need to put "1" on BOOT0 pin during reset. I know my MCU is not running my code (and also message from STMFlashLoader is different)

0690X000006DBISQA4.png

so it only can be in bootloader mode or running from embedded RAM. But as I said before nBOOT1 bit is "1" by default and I didn´t touch this, so it must be in bootloader mode.

I've searched for info and find this page: http://www.emcu.eu/2017/11/10/flash-loader/ that says: "ATTENTION. Up to now, 10-November-2017, there is a problem to program the STM32L0x1/2/3(32KFlash) using the standard Flash Loader (ver.2.8.0) present on the STM Internet site. If you had the necessity to program the STM32L0x1/2/3 download this release(ver.2.9.0) of the Flash Loader and use it." I downloaded this new version but the same issue.

0690X000006DBIJQA4.png

I find another app that also program flash using STM32 bootloader, FlyMCU v0.188 and it also can´t connect and if I try to get ChipInfo my MCU answer with all "0x00". I read STM32 bootloader and it says MCU waits to receive "0x7F" and answer with an ACK (0x79) or a NACK (0x1F) so it seems that this cable is not working properly because it seem it answer all with 0x00. I tried it with my 2 prototypes but result is the same.

0690X000006DBINQA4.png

I´ve done something wrong? I don't know what is happening. I also have 100k pull-up resistor on TX and RX lines like it suggests AN26060690X000006DBI8QAO.pngMaybe my 33Ohm resistors (R47 and R48) are degrading my serial port signals? Or this cable is not working? (I bought it in dealextreme to a chinnese shop and I don´t know if it´s original cable)

6 REPLIES 6

The TX pin of the FTDI needs to go the the RX pin of the STM32, usually USART1_RX (PA10)

Would perhaps also recommend the STM32 Cube Programmer app, it has replaced the old app, but you could just as easily go into RealTerm, in HEX mode at 9600 8E1 and send the 0x7F byte.

Alternatives here would be the device simply isn't running properly, in which case you check the orientation and levels seen on NRST, VDDA, etc.

Have you tested connectivity with a JTAG/SWD pod?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GFern
Associate II

I know Rx and TX pins are ok because, if not, I wouldn´t receive 0x00 from the MCU. If STMFlashLoader receives nothing it will show this message: "No response from the target, bootloader can not be started".

I used STM32 Cube Programmer to program and debug my MCU through SWD (using a ST-linkV2) and it goes everything well. But the final customer doesn´t need to buy a ST-Link to update firmware so I choose bootloader mode for this porpose. Final customer only needs a usb to RJ45 cable (cheaper and very easy to find) to download the new firmware.

Can I use Cube Programmer also for bootlader? I thought it only uses ST-link to debug and program STM32 MCUs.

Good idea to use RealTerm, in HEX mode at 9600 8E1 and send the 0x7F byte. But this reminds me something more, if I change in STMFlashLoader default baudrate (115200) to another it gets no response. Very strange again.

I also will buy another usb to rs232 cable to be sure if it's not a faulty cable.

This is getting weirder and weirder.

I used HTerm app and I saw the same result, I send 0x7F (1byte) and receive 0x0000 (2bytes).

Then I decided to see what happenning with another MCUs. I use a LoRa discovery kit I have (it uses STM32L072CZ MCU), put it in bootloader mode (Boot0 set at 1) and connect this board using USART1 (PA9 and PA10 pins) with a different cable I found (it has CH340 chip instead of FTDI). With Hterm app again I send 0x7F (1byte) and now I receive 0x00 (1byte).

Maybe STM32 MCUs have some protection by default and bootloader is not working? or maybe it´s because I'm using Windows10 and nothing works?

DChen.3
Associate II

Maybe you can to try the Boot pin to direct connect to VCC(3.3V) . I try my STM32F103 is OK

jnewcomb
Associate II

If you are looking for some ideas..

On my STM32G, I had to first disconnect the SWD / JTAG debugger! (was trying to verify steps for a customer)

villivateur
Associate

I have the same problem and finally find the solution.

1. Open STM32CubeProg

2. Connect to the board with ST-Link and SWD port

3. Navigate to Option bytes panel

4. Extract User Configuration list

5. Uncheck nBoot_SEL

You can read the descriptions to the right, and they explains everything.

I'm very annoyed that ST never make this clear in their documents.

villivateur_0-1733143987132.png