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

about '__attribute__((section(".non_init"))) ' problem.

Hi ,

   SDK:  nRF5_SDK_15.2.0_9412b96

   IDE:   SEGGER Embedded Studio V4.12(64bit)

   C language standard: gnu99

    code:

    u32 nums_hf  __attribute__((section(".non_init")));

    

int main(void)
{
    nums_hf=0;
    log_init();


    while(1){

        index=events_get_next_event(&flag);

       ......

       output_events_device_start_running(event);

       .........

}

void output_events_device_start_running(S_EVENTS_LIST *p_s_events)
{
.......
nums_hf++;
NRF_LOG_INFO("start running ......(%d)\n\r",nums_hf);//s_comm.u_comm_process.s_process.u_record_points.record_points);
......

}

output log:

<info> app: start running ......(1)

<info> app: start running ......(19792205)

<info> app: start running ......(19792206)

‘’nums_hf‘’ Used in only one place.

If change ‘’nums_hf‘’ defined as “u32 nums_hf”. It works will. 

Please help me to see what is going on.

Parents Reply Children
No Data
Related