Problem accessing Slave CM4 variables on a multicore master-slave project

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

Problem accessing Slave CM4 variables on a multicore master-slave project

4,096 次查看
Sam_im
Contributor II

Hi,
I 'm working on a master-slave multicore project using a i.MX RT1170 EVK compatible board (MaaxBoardRT). Freemaster is working greate on the variables from master project (CM7) but I have problem loading variables on slave project (CM4). 
I tried to add map files from CM4 debug folder and add slave variables from there but not value is showing.
Is there any way to access those slave project variables also in FreeMaster?

Thanks in advance,

0 项奖励
回复
8 回复数

4,068 次查看
MichalH
NXP Apps Support
NXP Apps Support

Hello, 

can you tell more about your connection from the PC to the target and if you use the TSA feature?

If using serial line, CAN, or USB, the freemaster accesses the core which implements the communication (CM7 in this case I guess). So the CM4  variable visibility and addresses depend on how the CM7 sees them in its address space. Normally, the CM7 should be able to see the OCRAM space of CM4 (0x20200000).

Be aware that if you use the TSA feature and TSA_SAFETY feature (enabled in freemaster_cfg.h), the access to "unknown" variables can be actively blocked by freemaster driver unless you put them all to any TSA table. You can experimentally disable the TSA and only use addresses loaded from the ELF file.

In case of using JTAG direct memory access (CMSIS-DAP etc.), all memories should be accessible, unless the JTAG is disabled.

Regards,
Michal

0 项奖励
回复

4,059 次查看
Sam_im
Contributor II

Hi,
Thanks for getting back to me.
I'm using MCU-Link pro (SWD) as the connection to the board. The TSA is disabled. 

siamak_riahi_im_0-1686744321814.png

 

0 项奖励
回复

4,054 次查看
MichalH
NXP Apps Support
NXP Apps Support

OK. When using SWD, the TSA does not matter. The FreeMASTER accesses the memory directly over DAP MEM-AP. Can you describe what addresses are not accessible? What memory is used as RAM by your CM4 project?

What values does the FreeMASTER show for the variables which do not work? Does it show zeros or question-marks?

In my case, the CM4 OCRAM (0x20200000) can be accessed in FreeMASTER over CMSIS-DAP well - I have created a FreeMASTER variable at this address and it can be both read and written.

Regards,
Michal

0 项奖励
回复

4,043 次查看
Sam_im
Contributor II

I try to import cm4 axf map file from the slave project debug folder. you can consider for example avValue variable from the list which has the address of 0x1ffe86c8;
I've attached the list. 

0 项奖励
回复

4,038 次查看
MichalH
NXP Apps Support
NXP Apps Support

The memory range from 1FFE_0000 to 1FFF_FFFF is referred as Code TCM and it is only visible in the CM4 memory map, not in the CM7 map. Also in my case, the CMSIS RDDI-DAP driver reports an error when trying to access this memory.

I'm not an expert for MEM-AP behavior, but this will most likely be caused by an internal bus structure and connection point where the DAP MEM-AP is connected.

As a workaround, I would recommend to change the linker settings of the CM4 project to use CM4 OCRAM for data (variables) storage.

Regards,
Michal

 

0 项奖励
回复

4,031 次查看
Sam_im
Contributor II

Thanks Michal for your responses,
I tried to define a variable in NCACHE_REGION which is in the OCRAM in CM4 core. this variable was incrementing to 1000000 and then set to zero.
The value in Freemaster was captured as a random number without chaning. it seems changes to variable in CM4 is not reflecting.

I will continue to test more and let you know until we figure that out.

Thanks again for your help.

0 项奖励
回复

4,016 次查看
MichalH
NXP Apps Support
NXP Apps Support

Hello,

what you describe typically happens when a cache is enabled. The FreeMASTER/JTAG accesses the physical memory storage of the variable which never changes as the variable remains in cache all the time.

I'd recommend to double check:

  • If M4 cache is indeed inhibited in this memory region.
  • Try to manually flush cache after incrementing the value - just as an experiment
  • See how CM7 sees the same memory location - this could indicate also how JTAG sees it.

Regards,
Michal

0 项奖励
回复

3,934 次查看
Sam_im
Contributor II

Hi,
I switched to use only CM7 and pass data between CM7 and CM4. Working with a multicore app is not obviously an option in freemaster. 
Thank you any way MichalH,

0 项奖励
回复