cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with custom external loader

AMerc.4
Senior

Hello i created a custom external loader following this guide. My check code in the main (see the video) works. I can read in memory mapped mode, i can write and i can erase sectors and full chip.

I can write to it simple bin files using stM32 Programmer, but, when i try to upload a touchGFX application (created following this video) the programmer say error "Error: failed to download Segment[1]". The full log is

00:50:06 : STM32CubeProgrammer API v2.4.0
00:50:12 : ST-LINK SN : 51FF6A064882575053240587
00:50:12 : ST-LINK FW : V2J36S7
00:50:12 : Voltage : 3.28V
00:50:12 : SWD freq : 4000 KHz
00:50:12 : Connect mode: Normal
00:50:12 : Reset mode : Software reset
00:50:12 : Device ID : 0x451
00:50:13 : UPLOADING OPTION BYTES DATA ...
00:50:13 : Bank : 0x00
00:50:13 : Address : 0x40023c14
00:50:13 : Size : 8 Bytes
00:50:13 : UPLOADING ...
00:50:13 : Size : 1024 Bytes
00:50:13 : Address : 0x8000000
00:50:13 : Read progress:
00:50:13 : Data read successfully
00:50:13 : Time elapsed during the read operation is: 00:00:00.007
00:50:24 : Flash sector erase ...
00:50:24 : Existing specified sectors are erased successfully Protected sectors are not erased
00:50:28 : Memory Programming ...
00:50:28 : Opening and parsing file: arlix3.elf
00:50:28 : File : arlix3.elf
00:50:28 : Size : 384660 Bytes
00:50:28 : Address : 0x08000000
00:50:28 : Erasing memory corresponding to segment 0:
00:50:28 : Erasing internal memory sectors [0 4]
00:50:30 : Erasing memory corresponding to segment 1:
00:50:30 : Erasing external memory sectors [0 3]
00:50:32 : Download in Progress:
00:50:41 : Error: failed to download Segment[1]
00:50:41 : Error: failed to download the File

I really need that this works, and i know that is maybe something stupid. I hope you can help me.

13 REPLIES 13
Bob Bailey
Senior

On threads with "answers", I'm not sure if its better to ask a follow up question here or start a new thread. But, for Octo-spi external loaders is it as "simple" as replacing the qspi calls with ospi calls in the loader code? (or just name our ospi functions with qspi names?)

Any example OSPI loaders ? I'm planning a project with the h735, and will likely need to multiplex my RAM and FLASH. If I use the DISCO port assignments for the FLASH, would the existing DISCO loader work ok?

Thanks,

Bob

If they are close enough, just wade in, everyone else does. If you think it would be clearer to start your own thread, or the current one is already 10-20 posts deep, do that and cite a couple of relevant threads. For different STM32 and QSPI IC best to start new threads, or be very specific about what you're using/talking about.

If memory chip, clocks and pins are consistent existing loaders can be used. For slight variations they can also be patched/modified in hours rather than days.

Good examples are sparse. ST didn't use HAL/CUBE for some of them, and the examples that do are often necessarily bloated and dependent on interrupts, which isn't necessary. HAL_Delay() issues can be addressed elegantly without.

On QSPI vs OSPI, there might be some L4+ examples floating around, but yes pretty much just need to switch the BSP code, make sure the interface comes up and maps the memory at 0x90000000. Programming dual-quad devices has some challenges as erase/write can complete out-of-order but if you wait for both it all works. Best to test the living snot out of the thing outside of the external loader environment as very difficult to debug otherwise. You can use board level LED's, USART's etc to provide side-band diagnostic output. Figure several man-days to properly implement and test.

These loaders shouldn't be as hard as ST makes them, QA teams need to test the stuff more thoroughly and hold everyone in the chain accountable..

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

Thanks for your reply.

(Figure several man-days to properly implement and test.) - that's disappointing considering that CubeMX should be able to generate them.

I'll probably have more questions once I get to that phase. Still preliminary here, working on disco boards with "shields". if the 176pin lqfp were more available this wouldn't be an issue (144 pin seems like it will be easier to get in my quantities)

Bob

They are supposed to have robots cleaning up and inspecting Fukushima, but results there have also been disappointing.

CubeMX will get you as far as the boiler-plate will weld together.

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