In starting a bootloader for my project that uses an s32k116, I found the application notes for the S32K1 with example code (s32k146, s32k148, s32k144). When import the example project into S32 Design Studio for S32 Platform, v3.5 , it does not compile. I get the attached error screenshot.
I have not modified the projects in any way.
I've used the examples for the following application notes
https://www.nxp.com/docs/en/application-note/AN12218.pdf
https://www.nxp.com/docs/en/application-note-software/AN12218SW.zip
https://www.nxp.com/docs/en/application-note/AN12323.pdf
https://www.nxp.com/docs/en/application-note-software/AN12323SW.zip
Is there a different example for S32DS 3.5?
解決済! 解決策の投稿を見る。
Hi @dparkinson
For S32K1 devices, the available bootloader applications include the ones you have already shared, as well as the Unified Bootloader Demo. At the moment, there is no bootloader application developed specifically for S32DS version 3.4 or later.
@VaneB ,
How can I allow function execution from a pointer that I assign the address by value?
It seems it is not related to RAM, specifically. my settings or something does not run if I specify the pointer to the drivers using the memory address.
I tried just defining a dummy function in my project and put it in the flash_driver flash space. function does not perform any flash activities If I use a function pointer that points to the function by name, it works ok. But if I point to the address in flash, to call the function, then it still throws the exception.
It generates the same code for the function, either way.
It seems the IDE, debugger, or something does not like this:
__attribute__((section(".flash_driver")))
__attribute__((optimize("O0")))
status_t test_func(void)
{
status_t result = STATUS_SUCCESS;
return result;
}
typedef status_t (*test_ram_func_t)(void);
g_ptestFunc = (test_ram_func_t)(uintptr_t)0x0000E800u;
But is ok with this g_ptestFunc = test_func;
Hi @VaneB ,
I moved everything over to using the unified bootloader with RTD. However, as soon as the code reaches trying to execute the flash drivers that are executing out of RAM, the debugger throws an exception.
Do I need to do something special in the linker or some setting to be able to execute code from the flash_driver portion of RAM?
I did not rewrite the ram flash driver with RTD, since that is only provided as a binary in the unified bootloader example. I did confirm in the debugger that the flash driver is in RAM.
The original project that used an old SDK works in the debugger in S32DS 3.5 and performs the bootload.
I'm attaching the project, if there's something you can see that is messed up?
I'm not attaching the toolchain files. I'm using RTD 2.0.0 for S32K1 processor. I am including the ECU-pro project that I've been testing with over the CAN bus. It skips the flash_driver.bin download. Instead, I have the flash_driver.bin converted to flash_driver.o and I compile it into a portion of flash. Then, my code copies that to RAM at startup. That modification seems to work fine.
Below are a couple screenshots from where the debugger fails. (It works when in the SDK version).
flash driver in RAM is the same as flash_driver.bin (with updates for pointer offsets)
hI @dparkinson
These applications were developed using S32 Design Studio for Arm. Over time, updates to the IDE have introduced changes to elements such as toolchain paths, library paths, and SDK configurations.
To ensure compatibility with the currently used IDE version, it is recommended to create a new project. Then, manually copy the application’s source files and any custom project settings from the original project into the new one. This approach helps avoid integration issues caused by version-specific differences.
BR, VaneB
Thank you for the response.
Are there any example S32K1 bootloader projects that work with S32DS?
3.5 prefer, but I'd be willing to try 3.4 or 3.6 if that's the only one available).
I would like to start with a known working project before I started to modify it for use with the S32k116.
Hi @dparkinson
For S32K1 devices, the available bootloader applications include the ones you have already shared, as well as the Unified Bootloader Demo. At the moment, there is no bootloader application developed specifically for S32DS version 3.4 or later.
@VaneB ,
Thank you. I'm starting to to work on migrating code. I'll try to post if I get something that works with S32DS. progress so far