Edit .C file variable in startup assembly file

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ChTa_4210396
Level 1
Level 1
First question asked

Hi Cypress Team,

I am using MB96600 Series F2MC-16FX controller and SOFTUNE Workbench ver-V01L32 for my project.

I have a customer requirement to perform RAM check at startup and reset if error is observed. This reset cycle should continue for 3 sec.

Currently I am performing RAM check in startup assembly file before calling main function and resetting until it is recorded.

I wanted to update one flag or variable value in case of RAM check error and use that flag/ variable in main function in main.c file.

I tried using .EXPORT command in assembly file to export C variable and update the value in assembly file. But I am getting wrong value in .C file

below is what I am trying

startup.asm

-

-

-

RAM_ERROR: .EXPORT __var_name

__var_name:

                      MOVL A, #__var_name

                      MOVW A, #0x55

-

-

-

.C file

UCHAR _var_name;

somefunction()

{

     UCHAR temp = _var_name;     //Getting incorrect value of _var_name

}

Could you please guide me here?

0 Likes
0 Replies