CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

how to solve Trap due to unimplemented FLASH memory access,

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dnatechnical



Joined: 26 Nov 2009
Posts: 19

View user's profile Send private message

how to solve Trap due to unimplemented FLASH memory access,
PostPosted: Tue Dec 08, 2009 9:09 am     Reply with quote

During simulation I find following message.
Anyone help me?
Quote:
Trap due to unimplemented FLASH memory access, occurred from instruction at 0x00370e
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 9:43 am     Reply with quote

These things happen.
If you expect a more specific answer, provide some information.
dnatechnical



Joined: 26 Nov 2009
Posts: 19

View user's profile Send private message

PostPosted: Sat Jan 09, 2010 9:45 pm     Reply with quote

I'm using modbus, I'm using dspic30f6010a.
Code:

float m_decp[0];

(modbus_write_multiple_registers(MODBUS_ADDRESS,0x201,2,m_decl[0]));

For this I get error:
Quote:
CORE-E0002: Trap due to misaligned data word access, occurred from instruction at 0x003a4c

PIC get reset.

Anyone can help for this?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Jan 10, 2010 3:44 am     Reply with quote

Looking at the prototype of modbus_write_multiple_registers, the problem reveals as a simple coding error
Code:
exception modbus_write_multiple_registers(int8 address, int16 start_address, int16 quantity, int16 *values);

The values argument must be supplied by reference: &m_decl[0].
PCD performs no type checking for pointers in function calls, so no type cast is required.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group