AnsweredAssumed Answered

Compiler defines for LPC43xx Multicore projects

Question asked by LPCware Support on Mar 31, 2016

Historically the LPCXpresso LPC43xx project wizards created a number of compiler defines at the time a multicore master project was created that could be used to determine what slave projects were linked to the master project:

  • LPC43_MULTICORE_M0APP
    • Configured for a Cortex-M4 master project when an M0APP project is linked to it at time of the master projects creation
  • LPC43_MULTICORE_M0SUB
    • Configured for a Cortex-M4 master project when an M0SUB project is linked to it at time of the master projects creatio

These symbols are thus used in the LPC43xx M4 main() code generated by the project wizard to determine whether to boot slave CPUs:

 

    // Start M0APP slave processor
#if defined (LPC43_MULTICORE_M0APP)
    cr_start_m0(SLAVE_M0APP,&__core_m0app_START__);
#endif
    // Start M0SUB slave processor
#if defined (LPC43_MULTICORE_M0SUB)
    cr_start_m0(SLAVE_M0SUB,&__core_m0sub_START__);
#endif

 

LPCXpresso 7.2.0 and later also provide a number of additional "__MULTICORE_ ..." compiler defines, providing a more flexible means of checking what form of multicore system is in use.

 

These newer style of defines have the major advantage of staying in step with any changes made to the "multicore nature" of a project after the initial project creation. For new projects, we would recommend the use of these "__MULTICORE_ ..." compiler defines rather than the old-style "LPC43_MULTICORE_ ..." compiler defines. Thus for example a forthcoming version of LPCXpresso will switch to using these defines in its slave boot code.

 

Master project defines:

  • __MULTICORE_MASTER
    • Defined automatically by LPCXpresso for a project which has been configured to be a Cortex-M4 Master project
  • __MULTICORE_MASTER_SLAVE_M0APP
    • Defined automatically by LPCXpresso for a Cortex-M4 master project when an M0APP project is linked to it [LPCXpresso 7.40 and later only]
  • __MULTICORE_MASTER_SLAVE_M0SUB
    • Defined automatically by LPCXpresso for a Cortex-M4 master project when an M0SUB project is linked to it [LPCXpresso 7.40 and later only]

 

Slave project defines:

  • __MULTICORE_M0APP
    • Defined automatically by LPCXpresso for a project which has been configured to be a M0APP slave project
  • __MULTICORE_M0SUB
    • Defined automatically by LPCXpresso for a project which has been configured to be a M0SUB slave project

For more information:

Outcomes