FreeRTOS, newlib and AP7000

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I am working on the NGW100 standalone development.

I have got my development environment up and running, with few drivers and some application code. I use newlib to setup interrupts and everything works fine.

Now, I want to use a RTOS and FreeRTOS seems to be an obvious choice, with the port available. Now, here is where my troubles start.

I want to use newlib for:
1. Interrupts and Exception.
2. Memory allocation.
3. Math library.

Now, I incorporate FreeRTOS and newlib. Problems while doing this:
1. Both newlib and FreeRTOS code handle the interrupts. Problems in compiling the code.
2. Both newlib and FreeRTOS code handle the exceptions. Again problems in compiling the code.

Also, it seems that the FreeRTOS handles the interrupts in slightly different way than the newlib code. The FreeRTOS code pushes a few more registers on the stack, than what the newlib code does. Is it ok using the newlib method for interrupts with FreeRTOS or it is safer using the FreeRTOS method for handling interrupts?

Has anyone had an experience in running newlib and FreeRTOS together?
Or Is there a way where I can take the required newlib source and just add to my project? Is is this doable or is just too much work?

Thanks,
drt

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I didn't check recently the newlib implementation but I am 99% sure that the current implementation of interrupts in the APx port of FreeRTOS is not compatible with newlib.
It is on the list of stuff I want to fix for the Ap7x - Unfortunatly, I don't have time to look at that before september (vacation..)

Ronan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply.

Any tips on what should be changed in code, I might give it a shot. Preferably FreeRTOS code.

-drt

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably the best start is to look at what is done in the freeRTOS UC3 port. I think you can override the newlib interrupt handler with yours

Ronan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I ported the FreeRTOS example to the hardware and my project workspace. It works great!! :D

I still use newlib for malloc (not tested yet), but this compiles ok.

I use the interrupt mechanism from FreeRTOS and not from newlib, which is ok. Well, I tried using newlib interrupt mechanism and FreeRTOS, but this did not work and I did not go far to make this work.

Thanks for the help,
drt