Memory read/write utility for P5040DS-PB

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Memory read/write utility for P5040DS-PB

1,610件の閲覧回数
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,312件の閲覧回数
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,312件の閲覧回数
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 件の賞賛
返信