[Probably solved] PIC32MZ2064DAS176 - executing out of DDR RAM
I am facing issue which I seem to be unable to solve. What I have:
Custom bootloader, which is able to load firmware into one of two flash banks (1 MB per app). This bootloader resides in combined lower and upper boot flash, with reserved areas excluded in linker script.
The application is about 350 kB in size, utilising multiple I2C lanes, 2x framed mode SPIs handling 8 channels of TDM audio (in/out) and another bunch of SPI devices including GLCD and Wiznet W5500. Plus one UART and 7 DMA channels. It uses FreeRTOS with most of internal RAM reserved for it. It uses dynamic allocation for which there is reserved lower 24 MB of DDR2 RAM.
The app is Harmony-free and works fine in either standalone mode, or when loaded through bootloader. The issue:
Another functinality I would like to get is being able to load "temporary" firmware into upper 8 MB of DDR RAM. This is acomplished by simply copying firmware into correct DDR location and jumping to its reset vector.
I thought I got this working, however after making some (in my opinion) totally unrelated changes to app, It fails to boot out of DDR RAM. Or, to be precise, it does not work as intended. It starts booting, but as soon as it gets to point where FreeRTOS should be started, it simply stops responding and is later rebooted by WDT. When I used some free rtos trace hooks, I was able to determine that first task gets selected, but never executes single line of code.
If I disable UART RX interrupt (which does not appear to be triggered according to my traces), I can see tht RTOS changes context few times and than just stops / freezes.
As I said, strange thing is that if I compile about week old version of my app, it works fine - and the changes made does not look like being able to cause such behaviour. Plus it works just fine out of flash.
I have got Pickit4, but it seems impossible to debug code loaded in such manner.
I am thinking there might be some issues with my "ramloadable" application linker script (I admit I dont really understand them that much): "ramloadable" linker file:
post edited by Morce323 - 2020/09/25 05:40:02