Can not flash LPC1837 MCU with LPC-link from MCUXpresso

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

Can not flash LPC1837 MCU with LPC-link from MCUXpresso

4,450 Views
shalindoshi
Contributor II

Hi,

I am using MCUXpresso IDE v10.1.0_589(Free Edition). and For Downloading to MCU Flash i am using LPC-Link (picture attached LPC-Link.PNG and its details in probe_details.PNG)

I am able to download same binary file to MCU flash partitions using redsuite 5(Licensed) IDE and same JTAG tool successfully, but when i download same with MCUXpressso IDE i get errors like below,

Failure_message.PNG

I do have configured flash, You can see my flash configuration as below, and using correct flash drivers for the MCU

Flash_configuration.PNG

please help me.

Thanks,

Shalin.

Labels (1)
12 Replies

3,521 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Shalin,

1 - remember as I said earlier, the .....BootA and .....BootB flash drivers set the internal flash to boot from respectively - therefore the ...BootA will set the Bank A as the bootflash, the ...BootB will set BankB as the bootflash. It is not sensible to use both of these drivers. Since you want to boot from BankB only specify the ...BootB driver i.e. the same driver for both flash banks

2 - if you extract a binary from a .axf file that spans multiple flash banks, this binary will contain null data for the areas between the end of the data in the first flash to the start of the data of the second flash. For example an image that programs something at the start of bank A, and then fills upto 1/2 way through Bank B, the binary size will be 0x1B040000 - 0x1A000000 in length. Furthermore, attempting to program this data will lead to an attempt to program null data in between the flashes leading to a 'No flash configured' error (as you have seen).

If you wish to program a binary that spans multiple flashes, then you should first split your image into flash regions - e.g. using objcopy, and then extract the flash binaries and program these separately.

When a load address is specified within the GUI flash programmer, this will be the base address used to start programming the data.

Alternatively you can of course program the .axf file in one operation since this file contains the necessary information to place the data correctly into the appropriate flashes

3 - you should not use both a default and a region specific flash driver.  You can see from the ProgramFlash commandline that a default flashdriver was specified.

4 - the Program Flash dialogue contains the progress log of the programming operation. From your screenshot, we can see the last few lines of this log information - the entire log is what we are looking for. You can simply copy this log and paste it into any reply.

Finally, it is clear that we do not fully understand what steps you are taking to perform the program operations.

Please start from the beginning and describe what you are doing - remember, if you don't tell us, we won't know:

1 - is there a single project that spans multiple flash devices?

2 - if so, can you debug this project (by using debug from the quickstart menu). If this is successful, please attach the debug log from this operation. (earlier in this thread I believe you said this works)

3 - if you are programming binaries, please describe how these are created - also, why are you choosing to program binaries rather than the .axf?

4 - assuming you are creating binaries that span only one flash region, are you saying that you are only able to program one of these and after this, the other regions fail to program?

5 - if you are programming multiple regions as separate operations, why would you want to reset the board when it is only partially programmed?

Just for clarity, in my local testing, I am not able to duplicate any problems programming these flash regions.

Yours,

MCUXpresso IDE Support.

0 Kudos

3,521 Views
shalindoshi
Contributor II

Hi,

  • I am using LPC1837 MCU custom board not any evaluation board from NXP. (this is not an issue because i can successfully program this board using RedSuite IDE)
  • I am accessing flash partition A(0x1a000000),Partition B (0x1b000000) and SPIFI (0x14000000) with respective driver LPC18x7_43x7_2x512_BootA.cfx, LPC18x7_43x7_2x512_BootB.cfx and LPC18_43_SPIFI_GENERIC.cfx for each.
  • Partition B(0x1b000000) contains the boot code
  • "Connection reset" or "Read time out" error that i have mentioned above is while accessing PARTION B (but this is random and also appears when i access PARTITION A or SPIFI region to flash)
  • For now when i see successful Flash operation for partition b below is the progress log

Sucessful_flash_partitionB.PNG

  • I have already attached "Connection reset" or "Read time out" error log information. Are you asking for some other log file, from where i should acquire it?

Thanks 

shalin

0 Kudos

3,523 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Hi Shalin,

To be able to duplicate your experience, please can you tell us exactly what you are trying to do:

- what board are you using (if this is a commercial board)

- what memory regions are you programming

- what flash region contains your boot code

- which flash drivers are you using

- what are the boot options (board, or OTP) set for this MCU

Supplying the log file for a successful debug (flash programming) operation (if you ever see one) would be helpful.

Yours,

MCUXpresso  Support

0 Kudos

3,523 Views
shalindoshi
Contributor II
Hi,
Thanks, Yes I am not seeing first two errors as of now, it is corrected by respective configuration settings.
Also, May be i have issue with resetting MCU when i use MCUXpresso "GUI Flash programmer".
I have observed that every time i try to flash using "GUI Flash programmer" i have to manually press the reset button of LPC1837 to be able to flash in respective partition.
and after every flash operation(partially successful) i see either "Connection reset" or "Read time out" error.
e.g. Using  "GUI Flash programmer" i have reset the MCU manually now when i try flash Partition B operation gets completed but at the end i see below errors.
Connection reset.PNG
Read time out.PNG

Note: when i use redsuite 5, i can successfully program using "GUI Flash programmer" same board (No issue with reset of LPC1837).
Thanks,
shalin
0 Kudos

3,523 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Hi Shalin,

Please let me add to Bernhard's comments.

There are two methods of describing a flash driver for a project. Either a default driver for the project (this will be used for New Project Wizard projects for the LPC18xx), or a per region driver. If per region drivers are specified, then these will override any default flash driver.

Please also understand the drivers here:

LPC18x7_43x7_2x512_BootA.cfx This driver is able to program BankA and also Bank B. After the programming operation, it will set the part to boot from BankA at 0x1A000000

LPC18x7_43x7_2x512_BootB.cfx This driver is able to program BankA and also Bank B. After the programming operation, it will set the part to boot from BankB at 0x1B000000

If you only intend to program the internal flash, then setting one of these drivers as the default, will be correct.

If however you intend to program, Bank A, Bank B, and also some external SPIFI flash (as part of a single project). Then you must specify a driver for each region.

But note: for the internal flash regions, the same driver should be selected since you will want to boot from either BankA or BankB (you can't boot from both of them!).

For the SPIFI flash region at 0x14000000, the generic driver LPC18_43_SPIFI_GENERIC.cfx should be specified.

Now regarding the problems you are seeing:

The first problem you reported was that no Flash is configured. I understand this was seen when using the GUI Flash programmer. I can only guess that you had failed to select the correct project when you tried this option. If you can reproduce this error please send the log file from the program operation.

The second problem of 'connection failed - Nn(05). Wire ACK Fault in DAP access' is a different issue. I would ask that you confirm that if you return to the previous debug tool to can still program this part. I would expect the success of a debug operation to be identical.

The following FAQ may be helpful to regain debug control.

https://community.nxp.com/message/630748 

Yours,

MCUXpresso Support

0 Kudos

3,523 Views
bernhardfink
NXP Employee
NXP Employee

Hi Shalin,

I made a short test, it works fine on my side, so it doesn't seem to be a generic problem.

  • I use MCUXpresso 10.1.0.589
  • I create a new project for the LPC1837 using the wizard (selecting an LPCOpen project and the lpcxpresso board lib)
  • I noticed that you don't need to provide the flash driver seperately, at least for the internal flash banks it's taken automatically
  • After all the steps I select the blinky project from the examples and build it
  • With an LPC4337 Xpresso board the download works fine, LED blinks. tested both FlashA and FlashB
  • With a Keil LPC1857 board and an external LPC-Link the download works fine as well (see attached screenshots)

Could you provide your output from the console window "<project name> Debug messages" as in my screenshot "Debug-message_Window.png".

Regards,

Bernhard.

0 Kudos

3,523 Views
shalindoshi
Contributor II

Hi,

Thanks, but i have already set respective flash partition and its driver as shown in attached picture.MCU Setting_flash_configuration.png 

0 Kudos

3,523 Views
bernhardfink
NXP Employee
NXP Employee

Hi Shalin,

the settings in MCUXpresso environment differ a little bit from the former LPCXpresso. One of these settings is the column "Driver" in the memory settings. In LPCXpresso this was hardcoded by selecting the LPC1837 as a device. In MCUXpresso you need to do this by hand for some of the "legacy" platforms.

Please click on "Edit" in the MCU settings window, then add a specific flash driver for the flash you want to program by clicking into the cell in the column "Driver". Then you see a drop down button and you can select a flash driver for the internal flash in LPC1837.

Regards,

Bernhard.

0 Kudos

3,523 Views
shalindoshi
Contributor II

Hi,

I have tried Flashing MCU partitions with LPC link-2 also, but still i am getting same errors as with LPC-Link.

Does i have to do some configuration or is there any specific hardware which can work with MCUXpresso IDE (GUI Flash programmer)?

Please, can anyone help me on this?

Thanks,

shalin

0 Kudos

3,523 Views
shalindoshi
Contributor II

Hi,

Yes, I am using LinkServer GUI Flash programmer

Though i have also tried to debug using the blue debug icon, and i am getting errors occasionally as attached picture

I am not able to attach image here, So link to image: https://drive.google.com/file/d/1JJtEqFZuZloEW87TIoZXM2SvyUzhJYgD/view?usp=sharing

Similar thing happens when i try to flash the program using LinkServer GUI Flash programmer.

Thanks,

Shalin 

0 Kudos

3,523 Views
shalindoshi
Contributor II

Some more information,

**************************************************************************************************

MCUXpresso RedlinkMulti Driver v10.1 (Nov  9 2017 16:45:39 - crt_emu_cm_redlink build 360)
Found chip XML file in E:/Coyote/MCUXpresso_CCM/OpImage_CCM/Release\LPC1837.xml
Reconnected to existing redlink server (PID 4294967295)
Connecting to probe 1 core 0 (server PID unknown) gave 'OK'
Probe Firmware: LPC-Link Probe v1.3 (NXP - LPC-Link)
Serial Number:  HID64HS12
VID:PID:  1FC9:0007
USB Path:
connection failed - Nn(05). Wire ACK Fault in DAP access.. Retrying
Failed on connect: Nn(05). Wire ACK Fault in DAP access
Connected&Reset. Was: NotConnected. DpID: 00000000. CpuID: 00000000. Info: <None>
Last stub error 0: OK
Last sticky error: 0x0 AIndex: 0
Debug bus selected: MemAp 0
DAP Speed test unexecuted or failed
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
(100) Target Connection Failed
error closing down debug session - Nn(05). Wire ACK Fault in DAP access

*********************************************************************************************************************

0 Kudos

3,523 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Shalin,

Are you launching a debug session or are you using the LinkServer GUI Flash programmer?

To start debugging a project on your target MCU, simply highlight the appropriate project in the ‘Project Explorer’, and then in the Quickstart Panel click on Debug 'Project Name', alternatively click the blue bug icon to perform the same action.


Note: The green bug icon should not be used because this invokes the standard Eclipse debug operation and so skips certain essential MCUXpresso IDE debug steps.


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer