Programming 4367 on pcb

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

Programming 4367 on pcb

3,649件の閲覧回数
dimitrissideris
Contributor III

Hi there,

I need some help for programming an lpc4367 mounted on a custom pcb.

I am currently using an swd 10-pin connector and trying to program and debug the above chip.

I am using an lpcxpresso 4367 dev board and set the jumpers so that i can program and debug an external mcu.

When i debug the process finishes normally without errors. Inside debug mode i see that the on-pcb mcu works because i see changed variable values as expected.

When I try to blink a led to see pgio functionality code variables work as expected but pcb doesn't work.

I have checked the pcb's pins that are the same of the processor pins.

I have some questions and any help would be very valuable.

I have read the datasheet but didn't clear things up.

1. What is the best practice for programming an empty chip on pcb?

2. Is debugging from another dev board with swd connector a good practice to program chip on pcb?

3. Does initial programming of an empty chip have anything to do with ISP boot mode?

4. Do i have to set pin p2_7 low at start every time or only if i want to enter some isp boot mode?

Maybe the questions don't make much sense but I would really like a map of how someone can program an empty chip.

Thanks in advance!

ラベル(2)
タグ(3)
0 件の賞賛
返信
10 返答(返信)

3,045件の閲覧回数
sagarpatil
Contributor II

Hello All,

I am using (OM13084: LPCXpresso43S67 Development Board,

I also need some help for programming an lpc4367 mounted on a custom pcb.

how should i proceed because i am doing it first time,

i have only JTAG interface on custom pcb,

so how should i connect wires from OM13084 to custom pcb,

is there any document or leads will help me most?

thanks,

 

0 件の賞賛
返信

3,045件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi SAGAR PATIL,

Please check the attachment, you can figure it out after have a look through the descriptions of the JP1, JP2 and P1.

Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

3,045件の閲覧回数
georgebou-rizk
Contributor I

I have the same problem except I am programming my custom board using an LPC-link 2 board.

I made an extremely simple program as seen below.

/*
===============================================================================
Name : TestProject.c
Author : $(author)
Version :
Copyright : $(copyright)
Description : main definition
===============================================================================
*/


#include "chip.h"
#include <cr_section_macros.h>

// TODO: insert other include files here

// TODO: insert other definitions and declarations here

int main(void) {

SystemCoreClockUpdate();

Chip_GPIO_Init(LPC_GPIO_PORT);

Chip_SCU_PinMuxSet(3, 5, SCU_MODE_FUNC0);
Chip_GPIO_SetPinDIR(LPC_GPIO_PORT, 3, 5, 1);


while(1)
{
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 3, 5, 0);
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 3, 5, 1);
}

return 0 ;
}

===============================================================================

Using the LPCXpresso4337 dev board and stepping through the code I was able to toggle the on board LED. I then plugged in my custom PCB and changed the code so instead of toggling pin 3.5 its toggling pin 1.8. I viewed the GPIO-PORT peripheral in LPCXpresso and see that pin 1.8 is getting set and cleared as i step through but no response on the PCB. The line i'm trying to toggle is simply going to an expansion header and has an external 100k pull up to 3V3. The line just stays high the whole time (viewing the line through a CRO). 

I have tried toggling other lines just to be sure but all of them have the same issue. I realise the dev board is a 4337 chip an my custom board chip is a 4367 but that shouldn't matter as they have the same memory mapping. 

I've tried programming through both SWD and JTAG.

I've also tried programming the board with similar code but with a delay in between toggles and programmed the board through CMSIS-DAP V5.147. The message says the board is programmed successfully but still no activity on the custom board.  Again this method worked for the LPCXpresso4337 board but not my custom board.

0 件の賞賛
返信

3,045件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi George Bou-Rizk,

The P3.5 pin is assigned to the GPIO1[15] (Fig 1) when setting the P3.5 work as the GPIO.

Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 15, 0);
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 1, 15, 1);‍‍

So you should use the following codes instead of the previous code.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,045件の閲覧回数
georgebou-rizk
Contributor I

Yep that was the problem.

,I just assumed pin numbers would map to GPIO numbers.  

thanks so much.

0 件の賞賛
返信

3,045件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Dimitris Sideris ,

According to your statement, I think the debug and program operation definitely work well and the root issue is the application demo hadn't work as expected.

LPCOpen sample:

LPCOpen Software for LPC43XX|NXP 

So I'd highly recommend you can some LPCOpen's demo on the customize board for checking.

Also I think you'd better to check the SCH of the board again.

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

3,045件の閲覧回数
dimitrissideris
Contributor III

Hi jeremyzhou,

I managed to program the pcb the way I described above. I use an lpcxpresso 4367 dev board, and use it to program an external mcu (lpc4367) that is on pcb. With an swd connector i program the pcb and debug it also.

There is an issue though that is crucial for my work. When i program the chip on pcb it seems like the code is loaded somewhere (flash memory??) in the dev board and not in flash of pcb mcu.

When i unplug the dev board the pcb does not work.

On the contrary when i was programming the on board mcu i used J5 connector (the link2 device) to debug the on board mcu and after that, i could use the J4 connector (only the on board mcu is powered on) and i could see that the on board target mcu was working fine.

This isn't happening with the external on pcb mcu. I debug-program the on pcb mcu from the dev board but when the dev board isn't using the link2 the pcb doesn't work?

How can i permanently pass code to pcb mcu?

I could really use some help so that i can move forward with my work

Thanks in advace!

0 件の賞賛
返信

3,045件の閲覧回数
pavelhudecek
Contributor III

I have using LPC11U68 on custom board and programing/debugging via LPC-link2. First I had to set jumpers and reprogram LPC-link2 via some program, that I found on the internet. May be the same problem with your LPCXpresso 4367?

0 件の賞賛
返信

3,045件の閲覧回数
dimitrissideris
Contributor III

I am using jumpers of lpc link2 correctly. I set it up for programming/debugging external mcu and its working.

My issue is that i cannot permanently pass code to on-pcb-mcu.

0 件の賞賛
返信

3,045件の閲覧回数
pavelhudecek
Contributor III

OK, my english is not very well:-)

1. If you are sure that the program is recorded into the LPC in custom board and not to the LPC on the dev board, check your memory configuration. If you accidentally load program into the RAM instead of the FLASH memory, software and hardware should work correctly, but after power off would disappear.

2. If you accidentally emulating instead of debugging, program working, but hardware not.

You try to edit a sample project for your LPC that come with LPCXpresso IDE for your board and check if working properly. If it's OK, put your code to this project.

0 件の賞賛
返信