Multicore FreeRTOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multicore FreeRTOS

4,607 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsideris on Thu Jun 09 08:05:20 MST 2016
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.
Labels (1)
0 Kudos
10 Replies

2,036 Views
ranjiththottath
Contributor I

I tried to debug the dual core freertos blinky example in lpcopen library to M0 core, but it shows it is not able to load to  M0 core using swd. So i am not able to run anything on the M0 core in Mcb4357. Im using Mcuxpresso and segger jlink. Any help on this is much appreciated.

0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos

2,037 Views
dimitrissideris
Contributor III

Hi,

I am trying to migrate from keil mcb4357 to lpcxpresso 4367.

I followed bavarian tips

-  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.

All the above went well but the following error occurs:

Building file: ../example/src/main.c

Invoking: MCU C Compiler

arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_LPCOPEN -DOS_FREE_RTOS -DCORE_M4 -D__MULTICORE_NONE -I"C:\Users\d.sideris\Desktop\LPC_workspace\LpcOpen\lpc_chip_43xx\inc" -I"C:\Users\d.sideris\Desktop\LPC_workspace\LpcOpen\lpc_board_nxp_lpcxpresso_4337\inc" -I"C:\Users\d.sideris\Desktop\LPC_workspace\LpcOpen\dc_freertos_blinky\example\inc" -I"C:\Users\d.sideris\Desktop\LPC_workspace\LpcOpen\dc_freertos_blinky\freertos\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mthumb -specs=redlib.specs -MMD -MP -MF"example/src/main.d" -MT"example/src/main.o" -MT"example/src/main.d" -o "example/src/main.o" "../example/src/main.c"

../example/src/main.c: In function 'prvSetupHardware':

../example/src/main.c:105:30: error: 'M0_IMAGE_ADDR' undeclared (first use in this function)

  if (M0Image_Boot((uint32_t) M0_IMAGE_ADDR) < 0) {

                              ^

../example/src/main.c:105:30: note: each undeclared identifier is reported only once for each function it appears in

make: *** [example/src/main.o] Error 1

In dc_freertos_blinky multicore settings i put slave m0app in flash memory B512.

In dc_freertos_blinky_m0 multicore setting i put multicore configuration M0APP.

Have i missed something for a board migration?

0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsideris on Wed Jun 15 03:30:17 MST 2016
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.
0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Tue Jun 14 05:42:57 MST 2016
No pain, no gain  8-)

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  ;-)

Regards,
NXP Support Team

0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Mon Jun 13 11:56:36 MST 2016

Quote: dsideris
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_Applica...

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

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsideris on Mon Jun 13 05:08:00 MST 2016
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?
0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Mon Jun 13 01:45:44 MST 2016
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.z...

It is for the
[list]
  [*]  LPC4357
  [*]  LPCXpresso toolchain
  [*]  Keil MCB4357 board
[/list]

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
0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dsideris on Fri Jun 10 09:32:22 MST 2016
Hi thanx for replying!

I have already downloaded the lpcopen library (although the official link is broken :) ) 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.

0 Kudos

2,037 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Fri Jun 10 04:25:05 MST 2016
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-cor...

Regards,
NXP Support Team
0 Kudos