Memory allocation problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

First you can see the figure.

   

Source Port variable data type is unsigned short so the next destport variable address is 0x20000D84.

   

destport variable datatype is also unsigned short but next seqNo variable address is not 0x20000D86  but  0x20000D88.

   

It is Psoc creator bug or my fault.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum!

   

It is not a fault, it is a feature 😉

   

You are probably using a 32-bit Arm M0 or M3 core which is a PSoC4 / PSoC5 chip.

   

Arm requires  to have 32-bit variables on a dword boundary (dividable by four), in this case not on 0x...86, but 0x...88 location.

   

 

   

Bob

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum!

   

It is not a fault, it is a feature 😉

   

You are probably using a 32-bit Arm M0 or M3 core which is a PSoC4 / PSoC5 chip.

   

Arm requires  to have 32-bit variables on a dword boundary (dividable by four), in this case not on 0x...86, but 0x...88 location.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for your valuable replay.

   

But I have read TCP Header so data comes in bytes format. when i have read Sequence no from TCP header i have get the data from 0x..88 but actually store from 0x..86 location so i have get complete wrong data onward and due to wrong control bits my TCP connection not establish. 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When defining data in a struct you may use the "packed" attibute. Look at this appnote and search for "packed"

   

 

   

Bob