industrialNETworXnetx

Rainer Versteeg

Rainer Versteeg

| 06.11.2008 | 12:49 | 7 replies

Getting value of an address

Hi,

I want to read out the value of an address. I set a breakpoint on the second code line.

INHALT_ADDRESS_OP1=ADDRESS_OP;     
INHALT_ADDRESS_OP=PEEK(INHALT_ADDRESS_OP1);

Hitop shows the following value of INHALT_ADDRESS_OP1 = 0x8010A0AD [HOST_EMPFANG_LED_COUNT]. That is the variable that i want know.

When i start the second line, than the netx hangs.

What is wrong in the source code.

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 06.11.2008 | 13:43

Hi Rainer,

the address "0x8010A0AD" is located into the SDRAM. Is the SDRAM controller configured?

Rainer Versteeg

Rainer Versteeg

| 06.11.2008 | 14:05

HI AJ,

What do you mean with SDRAM controller ?.

I can access other addresses like 0x8010908C.

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 06.11.2008 | 14:09

Hi Rainer,

Rainer wrote:
What do you mean with SDRAM controller ?.

The interface of the netX, where the SDRAM is connected to.

Rainer Versteeg

Rainer Versteeg

| 06.11.2008 | 14:39

HI AJ,

Yes, the SDRAM Controller is configurated.

I have an program on a PC which is connected over USB to the NETX.

Now i want to read out the values of my variables with the the help of the loadmap.

I sent the address of the variable which i can found in the loadmap to the NETX and get the value of the variable. Some variable i can access and some not.

I have the actual loadmap of my project.

Now, why i can not access the address ?

Br,
Rainer

M T

M T

Hilscher Gesellschaft für Systemautomation mbH

| 06.11.2008 | 20:23

Hm. Ever thought of what might happen if you do a DWORD access on a non-dword aligned address on the ARM?

0x8010A0AD is a byte aligned address and it cannot be accessed using 32bit load commands (That is what PEEK does. Look at the PEEK macro which is defined as *(volatile unsigned int)(a)).

The ARM will throw an alignment exception (data abort), and as I know HiTop, I assume this wonderful "debugging" program won't stop at a data abort exception automatically.

Regards

MT

Rainer Versteeg

Rainer Versteeg

| 12.12.2008 | 08:06

Hi,

How can i read out the value of INHALT_ADDRESS_OP1 = 0x8010A0AD [HOST_EMPFANG_LED_COUNT]. HOST_EMPFANG_LED_COUNT is TLR_UINT8.

Br,
Rainer

M T

M T

Hilscher Gesellschaft für Systemautomation mbH

| 12.12.2008 | 19:23

If you want to access odd addresses with DWORD pointers in C you will need to use the packed attribute which will split up every access into single byte accesses EVEN on correctly aligned addresses.

See GNU GCC documentation on attribute((packed)) usage.

Regards

MT

Login