after Renaming a structure code is not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

after Renaming a structure code is not working

1,760 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madhuvariar on Fri Jun 29 05:04:54 MST 2012
When I [B][COLOR=red]changed[/COLOR][/B] the [COLOR=red][B]global structure[/B][/COLOR] (used for CAN Communication in my code)[COLOR=red]name[/COLOR], the structure variables [COLOR=red]are not getting loaded properly[/COLOR]. And I am getting junk values.
When I reverted the structure name back to the previous name structure variables are getting laoded properly. 
This repeats even after I restarting the IDE / restarting the PC.

I am using [B]LPC11C24[/B] with LPCxpresso IDE 4.1.5, on windows 7 PC,
The clock frequency is 24MHz from a 12MHz xtal.
The following peripherals are also used in the code WDT for 2sec, I2C,
CAN, systicktimer, timer16A & ADC.  NO RTOS used.
The code uses [B]14K flash[/B] and [B]1K8 RAM[/B].
Reserved first 256 byte of RAM for  CAN drivers ( on linker descriptor).

HOw can I solve this issue?
0 Kudos
Reply
8 Replies

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madhuvariar on Sun Jul 01 02:59:01 MST 2012
No its not located on the 256 bytes which is reserved for CAN drivers
(the space for CAN drivers only reserved by editing linker descriptor file)
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by researchinnovation on Fri Jun 29 21:33:06 MST 2012

Quote: madhuvariar
When I [B][COLOR=red]changed[/COLOR][/B] the [COLOR=red][B]global structure[/B][/COLOR] (used for CAN Communication in my code)[COLOR=red]name[/COLOR], the structure variables [COLOR=red]are not getting loaded properly[/COLOR]. And I am getting junk values.
When I reverted the structure name back to the previous name structure variables are getting laoded properly. 
This repeats even after I restarting the IDE / restarting the PC.

I am using [B]LPC11C24[/B] with LPCxpresso IDE 4.1.5, on windows 7 PC,
The clock frequency is 24MHz from a 12MHz xtal.
The following peripherals are also used in the code WDT for 2sec, I2C,
CAN, systicktimer, timer16A & ADC.  NO RTOS used.
The code uses [B]14K flash[/B] and [B]1K8 RAM[/B].
Reserved first 256 byte of RAM for  CAN drivers ( on linker descriptor).

HOw can I solve this issue?




Hi..!!

Just go through code again , If you are using the same Buffer and pointer anywhere else, It might give you some junk value.
Go step by step and try to find out from which buffer or pointer  you are getting these values.
Have a look on your function and passing the arguments and change the variables accordingly Or, define your own variables in different .h file and include it in your main program.


Thanks & Regards......:)
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Fri Jun 29 09:18:25 MST 2012
is this variable located in the special 256bytes section by the linker description ? Changing variable name will put it in the data section, which is not read/write by the ROM CAN driver.

Angelo
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madhuvariar on Fri Jun 29 06:48:27 MST 2012
Thank you for ur suggestion,
As per your suggestion I tried refractor for renaming the structure,
but the same problem exists( the code is not working).

[B]PS: after changing these variables [COLOR=darkgreen]to local variables and[/COLOR] made some mechanism to pass the structure content , [COLOR=darkgreen]the code worked[/COLOR]. [/B]
[B]But I want to[COLOR=darkgreen] keep[/COLOR] this structure variable [COLOR=red]as global.[/COLOR][/B]
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Fri Jun 29 06:01:42 MST 2012
Hi,

Try using the refractor, this way all references to that name are updated automatically.

Right click on the name you want to change, choose Refractor->Rename.

Regards,
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 29 05:45:59 MST 2012

Quote: madhuvariar
Hope you are clear now.



Yes, now it's all clear :)
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by madhuvariar on Fri Jun 29 05:42:54 MST 2012
The structure I used for making a message packet of 11 bytes( to send through CAN )
and this packet is send through CAN as two CAN packets to another LPC11C24.
This structure has nothing to do with the onchip CAN drivers.

And its working fine with the current structure name.

I need to change the structure to follow some coding standard.
When I changed the structure name then the framed message packet of 11bytes is not correct.
There is no compilation error,

Hope you are clear now.
0 Kudos
Reply

1,747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Jun 29 05:18:21 MST 2012

Quote: madhuvariar
HOw can I solve this issue?



Switch your brain on and look where this structure is used :eek:

I don't know which structures you use and why this things don't work :rolleyes:

And don't change structures which are used in ROM ;)
0 Kudos
Reply