View previous topic :: View next topic |
Author |
Message |
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
how to solve Trap due to unimplemented FLASH memory access, |
Posted: Tue Dec 08, 2009 9:09 am |
|
|
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
|
|
Posted: Tue Dec 08, 2009 9:43 am |
|
|
These things happen.
If you expect a more specific answer, provide some information. |
|
|
dnatechnical
Joined: 26 Nov 2009 Posts: 19
|
|
Posted: Sat Jan 09, 2010 9:45 pm |
|
|
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
|
|
Posted: Sun Jan 10, 2010 3:44 am |
|
|
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. |
|
|
|