LPCXpresso Error

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

LPCXpresso Error

1,970 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 21 00:56:51 MST 2015
Hello,
when I wrote my code and then Debug (click from quickstart panel) I get error in attachments.

Labels (1)
0 Kudos
Reply
9 Replies

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 21 02:58:42 MST 2015
Thank you.

Now I set

LPC_SYSCON -> SYSAHBCLKCTRL |= (1 << 5);
LPC_I2C -> CONSET |= (1 << 6);//config CONSET (MASTER OR SLAVE)
LPC_IOCON -> PIO0_10 |= (1 << 2);//SCL config
LPC_IOCON -> PIO0_11 |= (1 << 2);       //SDA config


It's OK?

0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jul 21 02:34:17 MST 2015
Having looked more closely at your code, in I2CInit, you are enabling I2S but DISABLING everything else (including flash). You need to OR in the enabling of I2C.
0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jul 21 02:19:28 MST 2015
Something in your code is causing a HardFault - the PC is 0x5db2380 which is non existing memory.
0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 21 01:37:38 MST 2015
But I have a bug in my code. If I debug LED blinky  it's OK, when Debug my program I have an Error.

#ifdef __USE_CMSIS
#include "LPC122x.h"
#include "IO.h"
//#include "lcd.h"
#endif

#include <cr_section_macros.h>
#include <NXP/crp.h>

int k = 0;
uint16_t bits[10];


void I2CInit(){
LPC_SYSCON -> SYSAHBCLKCTRL = (1 << 5);
LPC_I2C -> CONSET = (1 << 6);//config CONSET (MASTER OR SLAVE)
LPC_IOCON -> PIO0_10 = (1 << 2);//SCL config
LPC_IOCON -> PIO0_11 = (1 << 2);       //sdA CONFIG
}

void I2CSend(uint8_t bit){
//LPC_I2C -> CONSET = (1 << 5);
LPC_I2C -> DAT = bit;
}

void DataSet(){
bits[0] = 0xA2; //slave addres
bits[1] = 0x0;//set pointer to zero position in register
bits[2] = 0x2;//set 12hour mode and 7pF quartz
//-************************************************************************
bits[3] = 0x4;//set pointer to a second register
bits[4] = 0;//sekunde
bits[5] = 0x45;//minute
bits[6] = 0x23;//hour
bits[7] = 0x15;//days
bits[8] =0x4;//weekdays
bits[9] = 0x12; //month
bits[10] = 0x11;//year
}


int main(void)
{
DataSet();
I2CInit();
//start condition
LPC_I2C -> CONSET = (1 << 5);
for(k = 0; k <= 2; k++){
I2CSend(bits[k]);
}
//restart condition
LPC_I2C -> CONSET = (1 << 5);
I2CSend(bits[0]);
for(k = 2; k <= 10; k++){
I2CSend(bits[k]);
}
LPC_I2C -> CONSET = (0 << 5) | (1 << 4);

while (1)
{

}
}



In a disassembly viewer I get:

05db2380:   Failed to execute MI command:
          -data-disassemble -s 98247552 -e 98247660 -- 3
          Error message from debugger back end:
          Cannot access memory at address 0x5db2380



0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 21 01:30:54 MST 2015
Yes I'am go to Launch configuration and then Debug tag and set Vector catch on true.
Now working.
0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 21 01:28:06 MST 2015
I do not understand what to do.
0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jul 21 01:22:31 MST 2015
And did you follow this FAQ for regaining debug access?
https://www.lpcware.com/content/faq/lpcxpresso/regaining-debug-access
0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Tue Jul 21 01:12:02 MST 2015
1. LPCXpresso v7.8.0 [Build 426] [2015-05-28]

2. LPC1227

LPCXpresso Debug Driver v7.8 (May 28 2015 02:56:34 - crt_emu_lpc11_13_nxp build 181)
Emu(0): Conn&Reset. CpuID: 410CC200. Info: HID64HS12
Debug protocol: SWD Frequency 3000 KHz. RTCK: Disabled. Vector catch: Disabled.
loaded v.2 On-chip Flash Memory LPC11_12_13_128K_8K.cfx
image 'LPC11_12_13 (128K Flash, min 8K RAM) May 21 2015 09:32:41'
NXP: LPC1227/301  Part ID: 0x00000000
Connected: was_reset=false. was_stopped=false
LPCXpresso Free License - Download limit is 256K
code (at 0x10000000) not set as written - corrupted at 0x10000000 (word 0)
10000000: 23010020 54000045 00001032 10000000     ..#E..T2.......
10000010: 0000036c 10000430 00001000 10000430    l...0.......0...
10000020: 000000c0 00000000 100002fc 10000035    ............5...
10000030: 00000000 b6721c04 f854f000 1c062300    ......r...T..#..
10000040: 61636020 8f5ff3bf 2d006965 2300d0fa     `ca.._.ei.-...#
10000050: 429e6123 6026d002 e0363340 d504072b    #a.B..&`@36.+...
10000060: 68e16860 f880f000 06ebe026 4b1bd507    `h.h....&......K
10000070: d1012b00 e01f2000 f852f000 2342e01c    .+... ....R...B#
10000080: d012421d d40807ab 2b004b15 6860d0f2    .B.......K.+..`h
10000090: 68a268e1 f8e0f000 6860e00e 68a268e1    .h.h......`h.h.h
100000A0: f894f000 d0ef2800 23c0e006 421d005b    .....(.....#[..B
100000B0: f000d004 1c30f833 e0012300 23021c28    ....3.0..#..(..#
100000C0: 28006020 2201d001 61234313 61632300     `.(...".C#a.#ca
100000D0: 33ff3301 d1b5429d 46c0e7fe 10000121    .3.3.B.....F!...
100000E0: 10000259 4b072000 601a4a07 4a084b07    Y.... .K.J.`.K.J
100000F0: 23016018 60136010 60134a06 4b062202    .`.#.`.`.J.`.".K
10000000: 00000000 00000000 00000000 00000000    ................
10000010: 00000000 00000000 00000000 00000000    ................
10000020: 00000000 00000000 00000000 00000000    ................
10000030: 00000000 00000000 00000000 00000000    ................
10000040: 00000000 00000000 00000000 00000000    ................
10000050: 00000000 00000000 00000000 00000000    ................
10000060: 00000000 00000000 00000000 00000000    ................
10000070: 00000000 00000000 00000000 00000000    ................
10000080: 00000000 00000000 00000000 00000000    ................
10000090: 00000000 00000000 00000000 00000000    ................
100000A0: 00000000 00000000 00000000 00000000    ................
100000B0: 00000000 00000000 00000000 00000000    ................
100000C0: 00000000 00000000 00000000 00000000    ................
100000D0: 00000000 00000000 00000000 00000000    ................
100000E0: 00000000 00000000 00000000 00000000    ................
100000F0: 00000000 00000000 00000000 00000000    ................
Target error from Commit Flash write: Ef(50): Flash driver failed to initialize
(crt_emu_lpc11_13_nxp) terminating due to request from GDB
SWD Frequency (Final): 3000 KHz.


0 Kudos
Reply

1,642 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jul 21 01:09:16 MST 2015
Which version of LPCXpresso are you using?

And what target MCU and which debug probe?

And please post your debug log:

https://www.lpcware.com/content/faq/lpcxpresso/debug-log

It would also be worth booting the MCU into ISP mode before starting the debug connection...

https://www.lpcware.com/content/faq/lpcxpresso/regaining-debug-access

[As a slight aside, as you have posted this into the LPC12xx forum, you are probably using a part in this family. In which case, you might also want to read this FAQ - https://www.lpcware.com/content/faq/lpcxpresso/lpc12-watchdog ]

Regards,
LPCXpresso Support


0 Kudos
Reply