fNET bootloader, invalid storage class for function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

fNET bootloader, invalid storage class for function

900件の閲覧回数
joao_ribeiro
Contributor IV

Hello NXP community,

 

I am using an Kinetis MK64FX512 and trying to build an ethernet bootloader.

I have started from scratch by creating a new project on MCUXpresso and then begin to import the libraries needed. I have copied fnet_stack and fnet_application from the FNET4.6.3 package and my main has the fapp_main() and fapp_hw_init()

The issue is that when I finally import the fnet_application folder and set it in the tool setting include, I get a massive number of compiling erros such as:

../CMSIS/cmsis_gcc.h:126:53: error: invalid storage class for function '__enable_irq'

__attribute__((always_inline)) __STATIC_INLINE void __enable_irq(void)

                                                     ^~~~~~~~~~~~

../CMSIS/cmsis_gcc.h:137:53: error: invalid storage class for function '__disable_irq'

__attribute__((always_inline)) __STATIC_INLINE void __disable_irq(void)

                                                     ^~~~~~~~~~~~~

../CMSIS/cmsis_gcc.h:148:57: error: invalid storage class for function '__get_CONTROL'

__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void)

                                                         ^~~~~~~~~~~~~

../CMSIS/cmsis_gcc.h:178:53: error: invalid storage class for function '__set_CONTROL'

__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control)

                                                     ^~~~~~~~~~~~~

../CMSIS/cmsis_gcc.h:202:57: error: invalid storage class for function '__get_IPSR'

 

It continues for a lot more.

 

At the cmsis_gcc.h (that I have not changed) I have :

 

/**

  \brief   Enable IRQ Interrupts

  \details Enables IRQ interrupts by clearing the I-bit in the CPSR.

           Can only be executed in Privileged modes.

*/

__attribute__((always_inline)) __STATIC_INLINE void __enable_irq(void)

{

  __ASM volatile ("cpsie i" : : : "memory");

}

 

Do you guys have any idea on what am I missing ?

 

Thank you very much in advance

 

Best regards

タグ(2)
2 返答(返信)

748件の閲覧回数
joao_ribeiro
Contributor IV

Hi NXP community,

I think I have the answer to my question already. Here is just what we did, it might help others:

We found that in the fapp.c we have the clock_config.h include and in our case we have the FNET_MK enable, therefore the include will be called from inside de function. Somehow it gets confused when the include is called there. If we replace this include to the top of the file, it compiles without the above erros .

void fapp_hw_init(void)
{
´#if FNET_MK / Kinetis Board specific initialization /
´#include "clock_config.h"   //  <---------  This one
/ Init clock to run mode /
BOARD_BootClockRUN();
´#endif

´#if FNET_LPC / LPC Board specific initialization /
extern void BOARD_InitHardware(void);
BOARD_InitHardware();
´#endif

´#if FNET_MIMXRT / i.MX RT Board specific initialization /
extern void BOARD_InitHardware(void);
BOARD_InitHardware();
´# endif

/* Default serial port initialization. */

fnet_cpu_serial_init(FNET_CFG_CPU_SERIAL_PORT_DEFAULT, 115200u);

 

/* Enable Interrupts.*/

fnet_cpu_irq_enable(0u);

}

Regards

0 件の賞賛
返信

748件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Joao,

I'm glad that you could solve your problems and thanks to post your solution.

Best Regards,

Alexis Andalon