Memory read/write utility for P5040DS-PB

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

Memory read/write utility for P5040DS-PB

1,735 次查看
rammurmu
Contributor III

Hi,

    Can anyone share the memory read/write utility for P5040DS-PB. I do have devmem2.c ( as attached ) that works fine for other targets. However it is not working for P5040.

 

The function "mmap" fails with EPERM [Operation not permitted] error. The "prot" argument was changed to "PROT_READ | PROT_WRITE | PROT_EXEC" , still it shows the same error[Operation not permitted].

 

Thanks and Regards

Ram

Original Attachment has been moved to: devmem2.c.zip

标签 (1)
0 项奖励
回复
2 回复数

1,437 次查看
Pavel
NXP Employee
NXP Employee
  • mmap returns an MMAP_FAIL and sets EPERM as errno when trying to map a file from a partition that is mounted with noexec option in RHEL-4.8
  • The problem occurs only for a 32 bit application running on a 64 bit system


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,437 次查看
rammurmu
Contributor III

Hi,

     I found the way to ready using the attached devmem2.c. The crux is address argument need to passed as 36 bit address, i.e. CCSRBAR + ADDR OFFSET should be 36bit. The mmap function will return correct mapping after that.

For example to read the BR0 ( OFFSET = 0x124000) ( CCSRBARL = 0xFE000000 , CCSRBARH = 0xF0000000 ). The final address of BR0 is 0xFFE124000

Thanks

Ram

0 项奖励
回复