This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

IAR7.7compile52832ERRS

I USE IAR7.7 AND v11.0

THERE ARE ERRS.

FS_REGISTER_CFG(fs_config_t fs_config) =
	{
		.callback = fs_evt_handler, // Function for event callbacks.
		.num_pages = NUM_PAGES,      // Number of physical flash pages required.
		.priority = 0xFE            // Priority for flash usage.
	};

#define FS_REGISTER_CFG(cfg_var) NRF_SECTION_VARS_ADD(fs_data, cfg_var)

#define NRF_SECTION_VARS_ADD(section_name, type_def) \
    __root type_def @ #section_name
    //__root type_def @ #section_name
#endif

Error[Pa094]: the object attribute "__root" is not allowed here

Error[Ta017]: Auto variable "fs_config @ "fs_data"" cannot be located to section fs_data

help !!!!

thank you

  • What SDK example are you testing? Where is the "#define NRF_SECTION_VARS_ADD(section_name, type_def) \ __root type_def @ #section_name //__root type_def @ #section_name" ?

  • HI, I don't know justahu's case but I got same errors with github nrf5-flash-storage-examples (fstorage_example_simple). The link to github example was here: devzone.nordicsemi.com/.../ ....and the solution is?

  • Hi,

    Move the FS_REGISTER_CFG(..) above the fstorage_test() function:

    FS_REGISTER_CFG(fs_config_t fs_config) =
    {
              .callback  = fs_evt_handler, // Function for event callbacks.
                    .num_pages = NUM_PAGES,      // Number of physical flash pages required.
                    .priority  = 0xFE            // Priority for flash usage.
    };
    
    
    static void fstorage_test(void)
    {
    		static uint32_t data;
     .
     .
    	
    

    Also replace app_uart.c with app_uart_fifo.c in your project. If you use app_uart.c printf will only print out the first byte (known bug with SDK 11). By adding app_uart_fifo.c you will also need to add app_fifo.c and add the path: Project->Options-> C/C++ Compiler -> Preprocessor tab, and add $PROJ_DIR$\..\..\..\..\..\..\components\libraries\fifo in the include directories list.

  • 3Q,,,,,,I GET IT

    FS OPR code /////////////////// SDK11.0 static void fs_evt_handler(fs_evt_t const * const evt, fs_ret_t result) { if (result != FS_SUCCESS) { } else { fs_callback_flag = 0; } } FS_REGISTER_CFG(fs_config_t fs_config) = { .callback = fs_evt_handler, // Function for event callbacks. .num_pages = NUM_PAGES, // Number of physical flash pages required. .priority = 0xFE // Priority for flash usage. }; static void fstorage_write(uint32_t pBuffer,uint16_t wlength) { uint8_t i = 0; / 注册存储使用 / / 初始化存储模块 */ fs_ret_t ret; ret = fs_init(); if (ret != FS_SUCCESS) { }

    flash_address = (uint32_t)fs_config.p_start_addr;/* get address */
    	
    

    /* 擦 / fs_callback_flag = 1; ret = fs_erase(&fs_config, fs_config.p_start_addr, 1);/ 擦除一页 / if (ret != FS_SUCCESS) { } while (fs_callback_flag == 1) {} / 写 */

    fs_callback_flag = 1;/* 实际的写入地址 addr=0x0007C000 */
    ret = fs_store(&fs_config, fs_config.p_start_addr, &pBuffer[0], wlength);//
    if (ret != FS_SUCCESS)
    {
    }
    while (fs_callback_flag == 1) {}
    

    /* 读 */ for (i = 0; i < wlength; i++) { flash_rdata[i] = *(fs_config.p_start_addr + i); } updata_para_flag|=0x01; } ///////////////////

Related