2024-04-29 04:42 AM - edited 2024-04-29 04:43 AM
I am working on NUCLEO-H563ZI evaluation board interfacing with QSPI external memory. I have done below steps,
I am able to do read and write.
I have created the external loader file.
I am able to run application code in external memory with debugger support.
Now i am trying to run application code from external memory with bootloader code but i am always ending up with code crash. Could anybody give a clue how to debug this issue?
Note: I have flashed the application code in external memory using cube programmer with external loader.
I have enabled the memory mapped mode in boot up code and able to see the app code in Ext memory.
I have written jump code like below and changed linker script also,
/* Disable Systick interrupt */
SysTick->CTRL = 0;
/* Jump to application */
jumpToApplication = (pFunction)(*(__IO uint32_t*)(APPLICATION_ADDRESS + 4));
__set_MSP(*(__IO uint32_t*)APPLICATION_ADDRESS);
jumpToApplication();
Solved! Go to Solution.
2024-05-08 12:34 AM - edited 2024-05-08 01:08 AM
It seems like a known issue with custom external loader and recent versions of CubeProgrammer (both standalone and CubeIDE embedded versions).
Solved: Re: External loader fails to download - STMicroelectronics Community this is the same issue i am facing here.
I replaced 0x480.stldr file with the flash loader given in the above link but it didnt work for me. Could you please give the solution for this issue.
I am using STM32CubeIDE_1.14.0.
2024-05-08 01:14 AM
You start mix two problems. 1. mapped read only mode fail 2. upload loader fail
I recomm for testing create little app for external load but load it into internal. Then in boot copy to external switch to mapped mode and try run.
2024-05-08 02:30 AM - edited 2024-05-08 02:30 AM
Yeah but first problem
1. mapped read only mode fail
for this like you suggested, i created a small app code for led blink and a small boot code to jump app code. Its works for me but sometime i get hard fault error. This consistency problem i can solve it later as it is less priority now.
2. upload loader fail
This is high priority task now, i am not getting clear solution. Could you please give the clear steps to resolve this issue, i am exactly facing same issue like mentioned in this post Solved: Re: External loader fails to download - STMicroelectronics Community
2024-05-08 02:37 AM
Seems like a different issue on a different chip from a build two years ago..
Debug the problem YOU have.
Start in your code that boots and step into your application. Understand at what point it stops working and what it was doing. You wrote this code so should be able to follow it.
Pay attention to the context the system has with respect to addresses and vector tables and the settings in the MCU. The clocks that are running and the memory that is configured and visible.
2024-05-08 03:05 AM
Nothing you've posted here with respect to logs/outputs support it being that issue. Further more the H563 is using 0x484.stldr
Now you have issues upload data to your platform?
On the execution side, make sure you have Error_Handler() and HardFault_Handler() that output useful and actionable data. Add diagnostic output so you can follow what's happening in your own code, and how far it gets, and at what point it stops functioning as expected.
Perhaps dump registers and memory content so you can see whats happening internally.
2024-05-08 04:40 AM
From example code i have changed the boot code like below, its working without any issues now. I have done many times power cycle the board, its jumping to app code correctly.
2024-05-08 04:51 AM
After disabling interrupts in Loader file, i am able to download the code to internal flash and external flash simultaneously.
2024-05-09 05:31 AM
Is it possible to download code to internal as well as external memory at the same time using cube programmer?
If yes, which address should i give as start address?
With cube IDE i am able to download but cube programmer i am seeing the hang like below.
2024-05-09 05:38 AM
You'd need to split the data into TWO .BIN covering the individual regions which are otherwise a long way apart, resulting in a file that's 2GB in size, and clearly not going to fit within a device with a fraction of that capacity.
A .HEX or .ELF can be sparse
2024-05-09 10:40 PM
Is there any tool to download .hex file into STM32H5 microcontroller?