2019-08-14 08:09 AM
Hi.
I am using the Uart Bootloader from the ROM.
I want to write my Programm to the Sysram at 0x2FFC3000.
I don't know why, but the Software ignores my commands.
It accepts the write Command, it accepts the adress. But when i write the Address it twice sends the Ack byte.
So when i want to send the number of bytes, the data and the checksum it threats them as Commands.
Do i have to do something special to use the serial debug mode?
2019-08-19 06:31 AM
Ok, after some CubeProgrammer log dissection, guessing and poking around i found out, that the write command is rather different from reading.
First you need to send the undocumented Command GetPhase (0x03 0xFC).
This command will send some bytes and the address where the rom will store the data.
Through the GetPhase command the software has to know where the ROM will store the data. In this case it is 0x2FFC2400.
Then you send the write command. As an address you give 0!
The write command does not use adresses. it uses Block numbers!
And the 1st block is not your image. It is a header.
(the 1st block is block number 0)
(See https://wiki.st.com/stm32mpu/wiki/STM32MP15_secure_boot#STM32_Header)
So you send 256 bytes header.
In the image header you have to specify where the image is loaded at (i used 0x2FFC2500) and the entrypoint ( also used 0x2FFC2500)
As type i used 0x10 (TF-A)
from that point on you can load your software at 0x2FFC2500.
Then after you're done with loading the Software you send the Go Command (0x21 0xDE)
As address you give -1 (0xFF 0xFF 0xFF 0xFF)
and then your software should be executed.
@A ST Supporter
Why is this no where documented?
2019-08-26 08:00 AM
Hi,
There is an upcoming AN5275 (STM32MP1 USB DFU/USART protocols used in bootloaders) which hopefully clarify all that points.
Be patient, currently planned in Q4.