FreeRTOS port on cc3200 launchpad based on cc3220 port
Hello,
I want to have a port of freertos on cc3200 launchpad, though TI provides an official port, it uses outdated freertos version (8.0.1). So I started with the cc3220 freertos port. AFAIK cc3220 and cc3200 are pin-to-pin compatible with the same ARM architecture, with the only differences being, cc3220 providing better power management, security and leaner driver libraries. I have followed the porting a demo guide, but I am not able to debug my application. If I skip debugging and just program my board from uniflash, the scheduler does not start, actually, the prvHardwareInit also does not start.
This is what I tried:
I imported the cc3220 demo in CCS, I updated the hardware includes to use the files from cc3200 SDK, instead of TI folder in the demo. Updated board initialisation and gpio api. I also updated target configuration which updates the ccxml.
First I tried only LED toggling without scheduling which works okay.
Then I tried with the scheduler, but after vPortStartFirstTask I was stuck at the IntDefaultHandler() because I was using CCS’ default linker .cmd file and cc3200’s default startupccs.c
Then I copied these two files from the Demo folder (CC3220SFLAUNCHXLFREERTOS.cmd and startupcc32xx_ccs.c).
On debugging I receive the following error and the debugger does not start:
CortexM40: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
CortexM40: Can’t Run Target CPU: Timed out while waiting for target powerup/polling a hardware resource.
And I also have a warning:
entry-point symbol other than “cint00” specified: “resetISR”
I am not sure what could be missing. Any help is appreciated!
FreeRTOS port on cc3200 launchpad based on cc3220 port
This sounds like a project configuration issue, rather than a FreeRTOS
issue (yet!). I would recommend leaving the linker script, start up
files, etc. provided by TI specifically for that chip in your project –
the ones that enabled you to have the LEDs blinking without the RTOS –
then update the interrupt vector table in those known working files to
install the three necessary FreeRTOS interrupt handlers – namely the
FreeRTOS SVC handler (which is just called once, to start the
scheduler), FreeRTOS SysTick handler (used as the RTOS tick interrupt),
and the FreeRTOS PendSV handler (used for context switching).
FreeRTOS port on cc3200 launchpad based on cc3220 port
update the interrupt vector table in those known working files to install the three necessary FreeRTOS interrupt handlers – namely the FreeRTOS SVC handler (which is just called once, to start the scheduler), FreeRTOS SysTick handler (used as the RTOS tick interrupt), and the FreeRTOS PendSV handler (used for context switching).I guess I exactly did that when I replaced the linker command file and startup file from original sdk to the files that i downloaded from the demo folder:
Then I copied these two files from the Demo folder (CC3220SFLAUNCHXLFREERTOS.cmd and startupcc32xxccs.c).My question is: Is that enough or do I need to add more changes?
FreeRTOS port on cc3200 launchpad based on cc3220 port
These are TI files, not ours, but I’ve just looked and:My question is: Is that enough or do I need to add more changes?Then I copied these two files from the Demo folder (CC3220SF_LAUNCHXL_FREERTOS.cmd and startup_cc32xx_ccs.c).
- The .cmd file is just a linker script. Nothing FreeRTOS specific there, just make sure you have the correct linker script for your part.
- startupcc32xxccs.c
void (* const resetVectors[16])(void) = { (void (*)(void))((unsigned long)&__STACK_END), // The initial stack pointer resetISR, // The reset handler nmiISR, // The NMI handler faultISR, // The hard fault handler defaultHandler, // The MPU fault handler busFaultHandler, // The bus fault handler defaultHandler, // The usage fault handler 0, // Reserved 0, // Reserved 0, // Reserved 0, // Reserved vPortSVCHandler, // SVCall handler defaultHandler, // Debug monitor handler 0, // Reserved xPortPendSVHandler, // The PendSV handler xPortSysTickHandler // The SysTick handler };Shows the vector table with the FreeRTOS handlers installed. It doesn’t look like there is anything else part number specific in there. Other than that, you have to have configMAXSYSCALLINTERRUPT_PRIORITY set correctly in FreeRTOSConfig.h for the part.