This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L930: linker errors after enabling FreeRTOS mutex & timer support in HALCoGen

Part Number: RM48L930

Hello,

I created a HALCoGen FreeRTOS project (selected the RM48L950ZWT_FREERTOS device) and with default settings built the code Ok in CCSv7.  Then I went back into HALCoGen, clicked on the OS tab, and enabled 'Use Mutexes', and 'use Recursive Mutexes'.  I also added some test code in to create 2 tasks then call  vTaskStartScheduler in main().

With this config I get a linker error for missing function xQueueCreateMutexStatic.   This is because the default settings in FreeRTOSConfig.h are configSUPPORT_STATIC_ALLOCATION = 0.   But when I change this to configSUPPORT_STATIC_ALLOCATION = 1 I then get 5 other linker errors (vApplicationGetIdleTaskMemory, xEventGroupCreate, xQueueGenericCreate, xTaskCreate).  Any thoughts on this?  On a side note, it seems that if I do change the default settings in FreeRTOSConfig.h they will be lost the next time I generate code in HALCoGen, since there is no #ifndef preceding the #define configSUPPORT_STATIC_ALLOCATION  0.  I'm new to HALCoGen and FreeRTOS, what am I missing?  All comments are welcome!

Thank you,

Keith

  • Update: I found the answer to my first question (link errors) from this post: https://e2e.ti.com/support/microcontrollers/hercules/f/312/p/626490/2320355.  Bottom line, this is a known issue in HALCoGen 4.07.00.  You must replace the mpu_wrappers.c file with the updated file from the post, then regenerate code in HALCoGen, then rebuild in CCS.

    My second question still stands...

    Regards,

    Keith

  • Hi Keith,

    If I understand correctly, your second question is how do you make a change to the default definition of configSUPPORT_STATIC_ALLOCATION without it being lost the next time you regenerate code?

    This can be done by placing the re-definition of this parameter in one of the user code sections in the file that is after the initial definition. This can be problematic; however, if you are required to build without warnings since this will give a warning about incompatible redefinition of configSUPPORT_STATIC_ALLOCATION.

    The second option is to keep your Halcogen build directory separate from your development directory. Certainly, on the first generation of code, you will need to move all files to your development project directory; but, for subsequent regeneration of code, you could only copy the files that change. i.e., the .h files should not change between code generation iterations so you could keep these in your development area while only copying in the updated source files from Halcogen.

    If the second question you are considering is about the link error, I would need to investigate a bit more. If possible, it would helpful if you could zip up the project and post to this thread so I can recreate and debug it.
  • Chuck, thanks for your response.  That is very helpful.

    Keith