Skip to main content
in mozbek we trust
Associate III
November 5, 2018
Solved

Use CubeProgrammer as UART Mode

  • November 5, 2018
  • 2 replies
  • 11528 views

Hey there,

i want to reach my flash memory through UART. I can do this with ST-Link device but now i want to do it with UART. I use STM32F091CC MCU and as datasheet says i configured the UART pins(PA9-PA10) as Asynchronus UART in CubeMX.

My baud rate is 9600 bits/s- word legth 8bits - parity - even and stop bit is 1.

In boot mode configuration. I try to use all configurations but i cannot reach the flash memory.

I coded all options(set and clear bitss) in main.c program and when i click connect button in cube programmer it gives me an error like that:

Please help me how to solve this problem.

Regards

This topic has been closed for replies.
Best answer by Igor Cesko

I tried to use STM32F091 with UART connection and STM32CubeProgrammer. I used UART pins PA2 and PA3. I used Nucleo board with integrated USB to UART virtual COM port (VCP). Connection is correct - no problem. See attached screenshots: see there given UART configuration, option bytes configuration (I just set externally BOOT0 pin to VDD), device memory is empty (no code inside). Please check this configuration in your side.

0690X000006CKuPQAW.png 0690X000006CKuUQAW.png

2 replies

Igor Cesko
ST Employee
November 5, 2018

There is no need to program the device with any firmware - the UART is used for direct communication with device through embedded bootloader. So - just set device into boot mode (by setting BOOT0 and BOOT1 pins/option bits) and restart it and then connect to device by UART by CubeProgrammer.

Regards

Igor

in mozbek we trust
Associate III
November 5, 2018

Hey igor i have only physical boot0 pin and it aldreay pulled-up but i am not sure how to set or clear the other selectable pins like nboot0-boot_sel etc.

Igor Cesko
ST Employee
November 5, 2018

In reference manual RM0091 see table in chapter "2.5 Boot configuration". There are two possible configuration how to enter into boot mode: the mode must be "System memory".

1) BOOT_SEL bit = 1, BOOT0 pin =1 , nBOOT1 bit = 1

2) BOOT_SEL bit = 0, BOOT0 bit =0 , nBOOT1 bit = 1

Tesla DeLorean
Guru
November 5, 2018

It would need BOOT0 pulled high, or for you to implement the system loader protocol.

In your own application, just use a regular terminal program, and implement something like X-MODEM, or Y-MODEM supported by the terminal. See the IAP examples for how this is done.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
in mozbek we trust
Associate III
November 5, 2018

i pulled high boot0 but if there any solution to make this reprogram flash memory with cube programmer or FLASHER

Tesla DeLorean
Guru
November 5, 2018
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..