LPC11U23 : problem setting TMS_PIO0_12

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC11U23 : problem setting TMS_PIO0_12

1,893件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dino on Wed Aug 29 02:01:16 MST 2012
Hi,
I have this very strange problem . If I try to configure the port PO0_12 as an output port setting the register
LPC_IOCON->TMS_PIO0_12 &= ~0x07;
LPC_IOCON->TMS_PIO0_12 |= 0x01; /* PIO 0_12 */
during the run time the program stops to work and a message appear :

No souce available for ""
View Disassembly

If I remove only these 2 lines the program works without problem .

Thanks
0 件の賞賛
返信
10 返答(返信)

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Thu Oct 18 16:06:40 MST 2012
Did you disable the interrupts before making the EEPROM call?  The EEPROM calls are part of the IAP commands and the interrupts need to be disable before making these calls.


Quote: Dino
I made some more tests and I found that writing in the eeprom generates the problem. I read the  AN11073 and made the same functions but sometime the program stop to works when writing data to eeprom. I'm using only the first 16 bytes

0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ianleslie on Thu Oct 18 01:45:15 MST 2012

Quote: Dino
Hi,
I made other tests. I removed all the breakpoints and the program works without problems. I set again the brakpoints and when the program stops sometimes  I have the same problems. I also made a release and at the moment it seems works correctly.
I'm using the library semihost to using the assert(x).

Any idea ?



I seem to be having similar problems on a LPC11A14.  I have TMS_PIO0_7 set up
as an output, works fine until I use the debugger which sometimes takes
the pin low on a breakpoint.  The TMS_PIO0_7 pin is only connected to the device being
controlled, so I assume the serial line debugger function on-chip somehow thinks TMS
is fair game. (Had I known I would have used a different pin for this control signal.)

Ian
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dino on Fri Aug 31 07:48:52 MST 2012
Hi,
I made other tests. I removed all the breakpoints and the program works without problems. I set again the brakpoints and when the program stops sometimes  I have the same problems. I also made a release and at the moment it seems works correctly.
I'm using the library semihost to using the assert(x).

Any idea ?
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dino on Fri Aug 31 01:50:40 MST 2012
I made some more tests and I found that writing in the eeprom generates the problem. I read the  AN11073 and made the same functions but sometime the program stop to works when writing data to eeprom. I'm using only the first 16 bytes
This is the function
void writeEEPROM(uint8_t * eeAddress, uint8_t * buffAddressWrite, uint32_t byteCount) {
unsigned int command[5], result[4];
command[0] = 61;
command[1] = (uint32_t) eeAddress;
command[2] = (uint32_t) buffAddressWrite;
command[3] = byteCount;
command[4] = SystemCoreClock / 1000;
/* Invoke IAP call...*/
iap_entry(command, result);
if (0 != result[0]) {
  //Trap error
  while (1)
   ;
}
return;
}

this is an example of the data
command[0] 61
command[1] 0
command[2] 0x10000040
command[3] 4
command[4] 48000
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Aug 30 07:55:57 MST 2012
@ Serge: Looks like an overseen line, no reason to worry about :)

@ Dino: I can't test your problem, because I've no U23 :mad:

As Serge mentioned already, it's important to set your IOCON register :rolleyes:

Did you enable IOCON clock in SYSAHBCLKCTRL (bit 16) ? Unfortunately it's Reset value is 0  :eek:

Note: I would recommend to add J4-11 = Reset to your SWD connection.
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Aug 30 06:32:59 MST 2012
Looks like i am a noob. I think i'll just keep quiet in the future.
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Aug 30 01:35:41 MST 2012
Isn't that his problem of #1 :confused:

Quote: Dino
Hi,
I have this very strange problem . If I try to configure the port PO0_12 as an output port setting the register
LPC_IOCON->TMS_PIO0_12 &= ~0x07;
LPC_IOCON->TMS_PIO0_12 |= 0x01; /* PIO 0_12 */

0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Aug 30 01:11:16 MST 2012
Ok the GPIO clock is enabled.
Now did you change the pinfunction because by default GPIO0_12 is NOT a gpio pin but the JTAG TMS function.

Bits 0 to 2 of the TMS_PIO0_12 (User manual 10462 7.4.1.13) register should be set to 0x1. The reset value is 0x0 (TMS function)
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dino on Wed Aug 29 06:17:19 MST 2012

Quote: Serge
a) Is SYSAHBCLKCTRL enabled for GPIO?
b) Pin PIO0_12 is TMS (Test Mode Select) for the JTAG connector by default. Did you set the function of GPIO0_12 to GPIO? Assuming you don't use the JTAG interface.


a) Yes :

[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void
[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][SIZE=2][B]GPIOInit[/B]( [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] )[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Enable AHB clock to the GPIO domain. */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2]LPC_SYSCON->[/LEFT]
[/LEFT]
[/SIZE][LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= (1<<6);[/SIZE]

[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Enable AHB clock to the FlexInt, GroupedInt domain. */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][SIZE=2]LPC_SYSCON->[/LEFT]
[/LEFT]
[/SIZE][LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= ((1<<19) | (1<<23) | (1<<24));[/SIZE]

[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]I'm using the lpc-link board connected to our board with [/SIZE][/LEFT]

[LEFT][SIZE=2]VIO_3V3x ( J4 - 1 )[/SIZE]
[SIZE=2]SWDIO ( J4 - 3 )[/SIZE]
[SIZE=2]SWCLK ( J4 - 5 )[/SIZE]
[SIZE=2]GND (J4 - 15 )[/SIZE][/LEFT]



[/LEFT]
0 件の賞賛
返信

1,882件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Wed Aug 29 02:22:08 MST 2012
a) Is SYSAHBCLKCTRL enabled for GPIO?
b) Pin PIO0_12 is TMS (Test Mode Select) for the JTAG connector by default. Did you set the function of GPIO0_12 to GPIO? Assuming you don't use the JTAG interface.
0 件の賞賛
返信