Menu

bootloader, invalid storage class for function

Stralows
2019-07-03
2019-07-03
  • Stralows

    Stralows - 2019-07-03

    Hello fNET forum,

    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
    Stralows

     

    Last edit: Stralows 2019-07-03
  • Andrej Butok

    Andrej Butok - 2019-07-03

    FNET has nothing with the CMSIS issue.
    BTW: MCUx is the worst IDE I have touched.

     
  • Stralows

    Stralows - 2019-07-03

    Hi Andrey Butok,

    Thank you for the reply. I will take this question elsewhere, I hope to find the solution

    Thank you
    Regards

     
  • Stralows

    Stralows - 2019-07-03

    Hi Andrey Butok,

    With a help of a colleague, I think we manage do find the issue.

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

    }

    Does it make sence?

    Regards

     
  • Andrej Butok

    Andrej Butok - 2019-07-03

    Yes. This is the application-specific code, so the include of external file may have not expected content.
    Moving of this include to the top is good decision.

     

Log in to post a comment.