NOTICE: This website will be shut down in the near future. Product content has moved to nxp.com. Forum content and FAQs have been moved to community.nxp.com. We encourage you to create a user account on nxp.com to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.

 

Multicore FreeRTOS

7 replies [Last post]
dsideris
Offline
Joined: 2016-06-09
Posts: 4

Hi there,

I have a 4367 LPCXpresso board and using LPCXpresso IDE.

I want to find an example of multicore application using in each core freeRTOS.

The only thing that i found is this:
https://www.lpcware.com/content/forum/lpcxpresso-multiprocessor-example

This example leverages IDE's multicore support but the example is without RTOS.

The other thing that I found is this:
https://www.lpcware.com/content/project/lpc43xx-dual-core-notes

This example is what I am looking for but it is only for Keil board and tools.

It would be very helpful if there was an example with multicore freeRTOS in LPCXpresso board and toolchain.

0
Your rating: None

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bavarian's picture
bavarian
Offline
Joined: 2012-01-10
Posts: 322

I think that all you need is already there: please load the LPCOpen 2.12 for lpcxpresso and the LPC4357 (ZIP file lpcopen_2_12_lpcxpresso_keil_mcb_4357.zip) and look out for the projects dc_freertos_blinky and dc_freertos_blinky_m0.

http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc-cortex-m3/lpc1800-cortex-m3/lpcopen-software-development-platform-lpc43xx:LPCOPEN-SOFTWARE-FOR-LPC43XX

Regards,
NXP Support Team

dsideris
Offline
Joined: 2016-06-09
Posts: 4

Hi thanx for replying!

I have already downloaded the lpcopen library (although the official link is broken Smile ) and the default multicore examples are multicore_mc_sa_blinky_m0app and multicore_mc_sa_blinky_m4. These examples are multicore examples but without freertos support in case that I didn't missed anything.

I want an example in lpcxpresso with multicore and freeRtos support. Something like a blinky example that one core blinks one led, another core blinks another led and these tasks are created by FreeRTOS task create api and handled by freeRtos task handler.

bavarian's picture
bavarian
Offline
Joined: 2012-01-10
Posts: 322

Indeed the link to the 2.16 for LPC4367 is currently broken on nxp.com. We will fix this.
But as you can see in my post above, there is an alternative: the package for LPC4357. The link is working and it contains the examples I mentioned. The 2.16 package does not contain these examples anymore.

Please download the LPC4357 package from here:

http://cache.nxp.com/files/microcontrollers/software/LPCWare/lpcopen_2_12_lpcxpresso_keil_mcb_4357.zip

It is for the

  • LPC4357
  • LPCXpresso toolchain
  • Keil MCB4357 board

The LPC4357 and LPC4367 have the same properties when it comes to compiler settings, so in a first step you can simply deal with the LPC4357 project as it would be a LPC4367 project. Just compile the stuff and download it to the LPC4367.
In a second step you can set the chip from LPC4357 to LPC4367 in the compiler settings and exchange some files which are relevant for the LPC4367 with its second M0 core (interrupt table, one or the other H file).

The dual core Freertos has not been seen as a real world example, that's why we have taken it out of the example set.

Regards,
NXP Support Team

dsideris
Offline
Joined: 2016-06-09
Posts: 4

Thanx again for replying!

Yes i have seen this example and thanx for the specific info.
I am new to embed tech so my question might sound basic.

If the above code can be compiled for 4357 or 4367 chip if someone has a different development board he cannot run the code?

My setting is NXP LpcXpresso 4367 dev board and lpcXpresso toolchain. If I don't have keil MCB board i can't run the code you mentioned?

Another question is why there is no real world example of freertos multicore? Are there any kind of restrictions or it is not efficient for someone to do this?

rocketdawg
Offline
Joined: 2012-06-13
Posts: 217

dsideris wrote:
Thanx again for replying!
Another question is why there is no real world example of freertos multicore? Are there any kind of restrictions or it is not efficient for someone to do this?

FreeRTOS for ARM uses SYSTICK for its core clock. The M0 does not have a SYSTICK. So there are differences.

check this out
http://www.freertos.org/FreeRTOS_Support_Forum_Archive/April_2013/freertos_LPC43xx_Dual_Core_Application_7273923.html

since you are asking about FreeRTOS, why not try to ask the FreeRTOS fourm as well?

bavarian's picture
bavarian
Offline
Joined: 2012-01-10
Posts: 322

No pain, no gain Cool

Of course it would be nice to have everything complete and in line, but that#s not always the case. The dual core setup of the LPC4357 is a good basis for the LPC4367, in case I don't want to use the third core. The fact that the dual FreeRTOS example is set up for the Keil board means that you need to change some things from the Keil board BSP to the Xpresso board BSP.
- Start with replacing the Keil board layer files with the board layer files from the Xpresso package.
- Replace the LPC4357 chip layer files with the files from the LPC4367 package.
- Change the compiler settings to LPC4367.

Running two FreeRTOS is a nice exercise, but indeed not a real world example for the LPC4300, putting aside little restrictions like the missing SysTick on the M0_App core. The fact that both cores access the chip resources with equal rights would make the real time behavior very unpredictable with 2 OS's. Running one OS and subcontracting a task to the other core (housekeeping & number crunching) is something which can be thoroughly planned, resource conflicts can be either avoided by design or by scheduling.

However, feel free to make something fancy out of such a dual FreeRTOS setup Wink

Regards,
NXP Support Team

dsideris
Offline
Joined: 2016-06-09
Posts: 4

I ll follow the pain then!

I saw in example codes that IPC works with and withtout FreeRTOS in both cores. Is it feasible to have one core M4 with FreeRTOS and the one or two M0s without FreeRTOS to exchange messages with IPC?

The big picture here for me is that i want to build a multi sensor device with a main MCU with additional bluetooth and wifi modules with their own M4 cores. So a simple case would be that wifi receives data, process them and then sends it to main MCU. Or a sensor possibly running in a M0 of main mcu exchanges messages with M4 of same MCU and then sends data to wifi module in order to transmit them.

So i am trying to figure out the best possible setup.

feedback