- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. How can I configure psoc_creator to create a structure similar to PSoC3 and PSoC5
An example of the problem:
Structure{
unsigned int dta1; // 0806
unsigned int dta2; // 0001
unsigned int dta3; // 0800
unsigned char data3; // 06
}
in PSoC3 i see in memory: 08,06, 00,01, 08,00, 06 - OK
in PSoC5 i see in memory: 06,08,00,00,01,00,00,08,00,06 - swapped bytes and int32
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To order packing allocation, that could be.
Please check it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is difference of endian.
So sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to change the project
of Kmmancad для PSoC5:
http://www.cypress.com/?app=forum&id=2492&rID=72859
I found only switching Register/memory here:
Project-->Build Settings-->...Compiler-->Code Generator --> Struct Return Metod
It does not help.
Replacement unsigned int uint16 helps to get 2 bytes but swapped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PSoC3 and PSoC5 (8051 and ARM Cortex) have different endianess.
As long as you do not rely on data collected from one of them and red-in by the other you will not notice any difference. When sending binary data from one to the other you will have to swap the bytes before further processing them.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
I assumed that i can change this in the psoc_creator with the settings.
For PSoC3 / 5 i try to use arrays instead of structures , but it will be ugly.
Maybe there are other options?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No other options.
I would start to solve the problem with the following thoughts:
The sender always knows WHAT it is sending and should know whether to transform it to a different endianess.
So the problem can be solved solely at the sender's side making the things a bit easier.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will look how this problem is solved in the project avast: github.com/lrds/lwip-psoc5
http://www.cypress.com/?app=forum&id=2232&rID=49032
Unfortunately, this project is too complicated for me. But I will try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are dealing with ethernet: the endianess of TCP/IP is defined and fixed (Idon't know right now wheter big or little endian) so there is no need to worry.
Bob