cancel
Showing results for 
Search instead for 
Did you mean: 

Modyfying linker script and makefile

aroni525
Associate II

Hello,

I have started using Touch GFX a few days ago. It works preety nice, running the first program on the F746-Disco board is a pleasure.

But.. I can't use this system as it is delivered by TouchGFX. In general I would like to keep the logic and whole API, but I need to change the RTOS, add a lot of hardware and make it easy to use from the STM32CubeIDE level.

First problem appeared when I have started compiling Cube generated project. It works ok until I add something to the resources (images) and the .text section for the flash memory exceeds 1024kB. So basic problem is, that it doesn't split the data onto internal flash and external NOR memory.

I have started modyfying the linker script and oryginal makefile to allow the program to compile properly. I have never worked on makefiles/linker before so I am noob at this. I have started to learn about this and read your original files from TouchGFX.

I don't get this thing:

_extflash_:
	@$(st_link_executable) -c -P $(binary_output_path)/target.hex 0x90000000 -Rst -EL $(st_link_external_loader)
 
_intflash_:
	@$(st_link_executable) -c -P $(binary_output_path)/intflash.hex 0x08000000 -Rst

Why you download whole program file (target.hex) to the external memory instead of using only "extflash.bin" for example?

I am able now to compile whole program, split it into parts and download sources to the both momories respectively. As far as the internal memory looks ok - program starts, I can debug it for a while until it want's to get data from the external memory, than vPortExitCritical() is called. I don't know what should I write there, I have tried with all of the filest (from your example) and it still doesn't work (there is something in the memory).

I don't know what do I expect from you... maybe some tips which can help me to port your work with Touch GFX into my projects? And what should I put into external memory, I am confused?

Thanks,

Arek

3 REPLIES 3
HP
Senior III

Hi there and welcome in the TouchGFX club!

If you want to integrate the whole TouchGFX design with CubeIDE I have made a few videos on how to get the procedure right. There are a few pitfalls when starting a new project so if you need some guidance looke here - https://www.youtube.com/watch?v=43qQhrXc3n4

for the QSPI external memory I have made this video - https://www.youtube.com/watch?v=237lPdMsDZs

It's more than just changing the linker script. The CubeMX doesn't change the QSPI settings the right way so I copied the HW timing settings from a TouchGFX example.

aroni525
Associate II

Yes!! Thanks a lot for your response.

I was close, I didn't notice that the qspi configuration is wrong. It confused me that the program was loaded into external memory through the external loader script properly. But this is a different algorithm, not the same qspi configuration as in cube project.

I didn't know that there is option of external loader in "Debug Configuration" tab. That also helped me, because I have wrote it by hand in makefile, now it's more comfortable to use.

Thanks again!

Have you ever tried to build your own external loader script for another memory chip?

I'm in the middle of that process!

It's not very well documented but I have found a project for the L4 series that I am reworking to work with the F7 series. Hopefully this should solve the only remaining problem I have on my custom board.