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.

RM48L950: FreeRTOS - PreFetch Abort when starting Scheduler

Part Number: RM48L950
Other Parts Discussed in Thread: HALCOGEN

Hello,

I'm having issues porting FreeRTOS 9.0.0 to the RM48 Development USB Stick. I've followed Halcogen's intructions to setup the proper interrupts (vPortYieldProcessor, vPortYeildWithinAPI) and I can trace the chip going all the way to portRESTORE_CONTEXT (in portASM.asm). When the program calls the portRESTORE_CONTEXT macro, it generates a prefetch abort.

I'm using heap_1.c. I've tested other heap_x.c with the same result, except heap_3.c which gives me a vApplicationMallocFailedHook instead.

What could cause such a prefetch error? Is it related to memory management?

Regards,

  • Hello Charles,

    Have you tried implementing the FreeRTOS version that comes with Halcogen? I don't believe Halcogen has all of the necessary hooks in place by default to support the newer 9.0 version. I have also copied one of our FreeRTOS experts on this reply so that they can also have a look and offer their advice if they have any regarding integration of FreeRTOS v.9.0.
  • Hello Chuck,

    Thanks for pointing that out. I've tried the included FreeRTOS example in Halcogen, and it works like a charm. Its on FreeRTOS 7.4.0, but I'm sure it will suffice my needs.

    I noticed the example Halcogen project is for a RM48L950ZWT. Is it portable to other RM4x chips or it has to be built-in Halcogen templates?

    Regards,
  • Hello Charles,

    Are you using an older version of Halcogen? I was under the impression that FreeRTOS v.8.0 was included with Halcogen. Also, each part number has a FreeRTOS setup selectable when you open a new project in Halcogen.

    Additionally, there are examples in the Halcogen Examples directory for each of the supported part number families including all of the RM4x devices.

  • Hello Chuck,

    I used Halcogen 04.06.01 for my blink test. I saw FreeRTOS 7.4.0 in the FreeRTOSConfig.h file, but the main os_* files are FreeRTOS 8.2.0. My bad!

    As for using other chips, let's say that I use a RM46L440ZWT for my actual project. Halcogen does not seem to have a device template with FreeRTOS for this specific device. I also noticed that Halcogen outputs slightly different FreeRTOS files than the version downloaded on FreeRTOS.org. What would be the easiest way to create an Halcogen project that includes the right FreeRTOS files and that is targeted to that specific chip?

    Thanks for you time, the support for these Hercules chips far exceeds what I expected.

  • Hi Charles,

    You should be able to select the RM46L852ZWT_FREERTOS and use it as your starting point. You will probably need to modify the linker command file to adjust the memory sizes since the higher part number(superset device) will have more memory associated with it. You may also need to pay attention to peripherals included as some in the superset device may not be included in the smaller one. Since I haven't specifically done this, I can't speak to all the ins and outs of it. I will ping our FreeRTOS expert to chime in as well incase he has anything to add.
  • Hi,

    As Chuck mentioned, for every device family we have added FREERTOS support for one of the part numbers. You could always use that as a reference project. For other part numbers, you may need to change the linker command file as he mentioned. The flash and RAM memories sizes are different for each part numbers. You may also need do changes in the clock configurations. The default clock settings provided in  the HALCoGen may vary with different devices.

    In case you want to port FREERTOS on any RM48x device, I would suggest you to create a HALCoGen project with RM48L950ZWT_FREERTOS. Do changes in the GUI so that the clock settings are similar to your target device. Also create another project with your target device. Generate code for both and then combine the generated files.

    Let me know if you find any trouble doing the same.

    Thanks and Regards,

    Veena