Manually defined global variable value not updating

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Manually defined global variable value not updating

跳至解决方案
2,459 次查看
nxf64834
NXP Employee
NXP Employee

Hi Team,

One of our customer is using KV4x and taking SDK example UART Freemaster code as reference, they are adding a global variable in main file. The values of these global variable is not getting updated in 'Variable watch' while other pre-defined variables are getting updated properly.

Please refer screenshot where value column is showing '?'.

Any help is appreciated.

Thanks.. 

0 项奖励
回复
1 解答
2,436 次查看
TomasK
NXP Employee
NXP Employee

Hello,

mentioned SDK example UART Freemaster's code is using TSA feature (no need to load application's elf file), see definitions in "freemaster_cfg.h":

// Target-side address translation (TSA)
#define FMSTR_USE_TSA           1   // Enable TSA functionality
#define FMSTR_USE_TSA_SAFETY    1   // Enable/Disable TSA memory protection

It means that each variable must be defined with one of TSA macros (e.g. FMSTR_TSA_RO_VAR or FMSTR_TSA_RW_VAR) defined in "freemaster_tsa.h" otherwise the "read" and "write" functionality for new variable is disabled (checked if macro FMSTR_USE_TSA_SAFETY set) - indicated as "?" in Freemaster.

Another approach is to disable TSA feature completely (macro FMSTR_USE_TSA) and load the application's elf file. Then all used variables are available for "read" and "write" and their values visible in Freemaster's variable watch window.

Mixing TSA and usage of elf file does not make sense and could be confusing, so please define the gobal variable with TSA macros or disable TSA.

在原帖中查看解决方案

0 项奖励
回复
1 回复
2,437 次查看
TomasK
NXP Employee
NXP Employee

Hello,

mentioned SDK example UART Freemaster's code is using TSA feature (no need to load application's elf file), see definitions in "freemaster_cfg.h":

// Target-side address translation (TSA)
#define FMSTR_USE_TSA           1   // Enable TSA functionality
#define FMSTR_USE_TSA_SAFETY    1   // Enable/Disable TSA memory protection

It means that each variable must be defined with one of TSA macros (e.g. FMSTR_TSA_RO_VAR or FMSTR_TSA_RW_VAR) defined in "freemaster_tsa.h" otherwise the "read" and "write" functionality for new variable is disabled (checked if macro FMSTR_USE_TSA_SAFETY set) - indicated as "?" in Freemaster.

Another approach is to disable TSA feature completely (macro FMSTR_USE_TSA) and load the application's elf file. Then all used variables are available for "read" and "write" and their values visible in Freemaster's variable watch window.

Mixing TSA and usage of elf file does not make sense and could be confusing, so please define the gobal variable with TSA macros or disable TSA.

0 项奖励
回复