2018-11-05 04:16 AM
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
Solved! Go to Solution.
2018-11-08 02:34 AM
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.
2018-11-05 05:31 AM
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
2018-11-05 05:33 AM
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.
2018-11-05 05:40 AM
i pulled high boot0 but if there any solution to make this reprogram flash memory with cube programmer or FLASHER
2018-11-05 05:41 AM
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.
2018-11-05 05:49 AM
With BOOT0 High it should work, unless you have other interfaces creating noise on potential input pins. Review AN2606
2018-11-05 05:54 AM
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
2018-11-05 05:56 AM
After option bytes programming please perform power-on reset (power off and on) - to be sure that the new option bytes are loaded.
2018-11-05 06:03 AM
BOOT0 pin is physical high and i do not anything in software it is okey. boot_sel and nboot1 is set by software like this:
SET_BIT(FLASH->OBR,FLASH_OBR_nBOOT1);
SET_BIT(FLASH->OBR,FLASH_OBR_BOOT_SEL);
I opened CubeProgrammer and click connect button and it doesnt change anything it still tell me same error
16:54:00 : Serial Port COM1 is successfully opened.
16:54:01 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
Maybe i have problems with restarting my mcu. What do you think about it
2018-11-05 06:08 AM
It seems OK. You can program the option bits also by STlink hardware and CubeProgrammer. You can check the option bits states also by CubeProgrammer (or by STlink Utility software) with connection with STlink.