cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
McUsuf
Newbie
Newbie
522 Views
Registered: ‎08-20-2020

Types miscasting on MicroBlaze

I have a char array[4] - 4 bytes, so I'm trying to cast char* to int* but the value of int is wrong.
I used mrd and noticed that MicroBlaze shows only addresses which are multiples of four.
So, if my array is starting not from multiple of four address, i can't cast it normally, am I right? 
UPD: Is it normal that mrd shows only multiple of four addresses?

Capture.PNG

0 Kudos
4 Replies
katsuki
Xilinx Employee
Xilinx Employee
510 Views
Registered: ‎11-05-2019

 

Hi @McUsuf

 

This seems to be a general topic about C programming, not something specific to Xilinx products.

How about running the same program code in another development environment such as Linux or Visual Studio?

 

Thank you


Please mark the Answer as Accept as Solution if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.


Don’t forget to reply, kudo, and accept as solution. If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs
0 Kudos
McUsuf
Newbie
Newbie
508 Views
Registered: ‎08-20-2020

Debugged this code in VS before MicroBlaze & it was working.
0 Kudos
katsuki
Xilinx Employee
Xilinx Employee
369 Views
Registered: ‎11-05-2019

 

Hi @McUsuf 

 

The following articles may also be helpful to you.

cast char array to integer

 

Thank you


Don't forget to reply, Kudo, and Accept as Solution.


Don’t forget to reply, kudo, and accept as solution. If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs
0 Kudos
katsuki
Xilinx Employee
Xilinx Employee
319 Views
Registered: ‎11-05-2019

 

Hi @McUsuf 

 

If already issue has resolved, Kudo, and Accept as Solution.
If you have any questions, you can post them.

 

Thank you.


Don’t forget to reply, kudo, and accept as solution. If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs
0 Kudos