2021-12-26 11:23 PM
I have a question about the flash program function by UART communication on the evaluation board NUCLEO-L433RC-P.
After rewriting flash with UART, I restarted it with Run After Program, but it does not work properly (LED blinks if it is normal).
Unplug the USB cable and plug it in again to run normally(LED blinks).
It works normally if it is restarted by writing the option byte without restarting with Run after program.
However, I think that restarting with write option bytes is prepared for it to work well after writing option bytes.
For that reason, I would like to reboot in another way.
How do you run the application after rewriting flash with UART during VDD turned on?
I would like to update the software by connecting only the 4 pins of UART TX, RX, VDD, Ground.
Best regards,
2021-12-27 05:07 AM
Use UART isnt standart development programming way. Why not STLINK?
How you have setup BOOT0 pin?
2021-12-27 05:50 AM
The 'L433 is pattern 6 in AN2606, i.e. after reset it goes into bootloader mode when FLASH is "empty", and it keeps doing this until power-on reset or OBL_LAUNCH happens (the latter probably explains why rewriting options results in program start).
I don't say this surely is the problem here, and I don't know what would be the remedy. You can try to clear FLASH_SR.PEMPTY from CubeProgrammer, although I'm not sure what's the proper way to do that, as the description in RM0394 is rather messy.
JW
2021-12-27 05:02 PM
Thank you for your prompt reply.
Is it possible to set OBL_LAUNCH from CubeProgrammer via UART connection?
Best regards,
2021-12-27 05:21 PM
Thank you for your answer.
As you say, I use ST-Link on the evaluation board.
We are considering not mounting the JTAG / SWD connector on our printed circuit board to reduce the area.
> How you have setup BOOT0 pin?
BOOT0 is 0 because I'm trying the red frame mode of the attached Pattern 6 in AN2606.
Best regards,
2021-12-27 05:38 PM
I don't know, sorry.
I don't use the bootloader. Tried to have a look at AN3155 but I don't know whether the Write Memory command allows to write into registers. Heck, I even don't know what CubeProgrammer does when you use the Run program option - it should use the Go command, probably, but then it shouldn't be affected by the PEMPTY flag... Maybe switching on more detailed logging in CubeProgrammer could reveal more details?
JW
2021-12-27 05:54 PM
Thank you for your kind cooperation.
I will proceed by rewriting the option byte instead of the Run after program.
Currently it seems that CubeProgrammer cannot overwrite the same value.
Please tell me how to overwrite the same option byte because any method can be used.
Best regards,
2021-12-27 06:27 PM
As you said, I think it's a Go command.
The log of the relevant part is as follows, and Ack (0x79) is returned for Go command, so the command seems to be successful.
My application works with Power On Reset, but it doesn't work with Go command, I thought I needed something different from Power On Reset.
I find it difficult to identify the cause.
11:09:36:020 : Download verified successfully
11:09:36:031 : RUNNING Program ...
11:09:36:032 : Address: : 0x08000000
11:09:36:032 : Sending Start command and its XOR:
11:09:36:032 : byte 0x21 sent successfully to target
11:09:36:032 : byte 0xDE sent successfully to target
11:09:36:032 : Wait ends after 1 loop, dataready = 1, delay = 1
11:09:36:033 : Received response from target: 0x79
11:09:36:033 : Sending start address and its checksum:
11:09:36:033 : data sent successfully to target: 0x0800000008
11:09:36:033 : Wait ends after 1 loop, dataready = 1, delay = 2
11:09:36:033 : Received response from target: 0x79
11:09:36:033 : Start operation achieved successfully
11:09:36:042 : Sending GetID command and its XOR:
11:09:36:054 : byte 0x02 sent successfully to target
11:09:36:055 : bytesToWrite before send = 1
11:09:36:055 : bFlushRet = 1, bytesToWrite after flush() = 1
11:09:37:025 : waitForBytesWritten Error : **********
11:09:37:205 : byte 0xFD sent successfully to target
11:09:38:206 : Wait ends after 1 loop, dataready = 0, delay = 1001
11:09:38:206 : Timeout error occured while waiting for acknowledgement.
11:09:38:206 : No response from target received
2021-12-28 12:02 AM
2021-12-28 12:29 AM
Seems CubeProgrammer bug
11:09:36:031 : RUNNING Program ...
11:09:36:032 : Address: : 0x08000000
11:09:36:032 : Sending Start command and its XOR:
11:09:36:032 : byte 0x21 sent successfully to target
11:09:36:032 : byte 0xDE sent successfully to target
11:09:36:032 : Wait ends after 1 loop, dataready = 1, delay = 1
11:09:36:033 : Received response from target: 0x79
11:09:36:033 : Sending start address and its checksum:
11:09:36:033 : data sent successfully to target: 0x0800000008
all seems good your app is started, but next command getID is fail maybe check from progg if app realy start.
You need attach debuger at this moment and check WTF ... ahh you dont have connector