Kinetis FlexNVM

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

Kinetis FlexNVM

8,505 Views
hagguisouhail
Contributor III

Has any one succeeded to configure the memory linker to use the flexnvm as a pflash, i tried with the example in the mcuxpresso section 14.3 Configuring projects to span multiple Flash Devices  (Configuring projects to span multiple flash devices  ), however the program doesnt work and it runs into the hardfault routine. I will be kindly thankful for any help plz.

Pleaze find attached an example that i am working with.

Best regards,

29 Replies

5,728 Views
hagguisouhail
Contributor III

Hi Miguel,

After being able to split the .text memory section between PFlash and FlexNVM with the updated SDK, I am trying to run the OTA with the NXP Test tool. What I see is that I am able to do the OTA succesfully when the hole image is located on the Pflash section. However, since my project that I am building around the bluetooth_otac doesn't fit only on the PFlash, I was not able to run the NXP Test Tool which stucks each time I am selecting an Image file (*.bin or *.srec) that have been created from my project. Could you please help me with this issue ? Thank you.

Best regards,

Souhail

0 Kudos
Reply

5,728 Views
miguel_reyes
NXP Employee
NXP Employee

Hi hagguisouhail‌, 

We identified this issue after the software release. The current release doesn't support the FlexNVM when performing Over-The-Air upgrades. This example code is currently under development and it will be available in the upcoming maintenance release currently scheduled for December.

Sorry for the incovenience. 

Best regards,

Miguel  

 

5,724 Views
hagguisouhail
Contributor III

Hello Miguel,

I would like to know if there is any progress concerning the OTA with support for the FlexNVM because I really need this functionality.

Best reagards,

Souhail

0 Kudos
Reply

5,722 Views
EdgarLomeli
NXP Employee
NXP Employee

Hello hagguisouhail‌,

There is available the document Reprogramming a KW36 device using the OTAP Client Software, here is explained the FlexNVM storage functionality. I hope will useful for you. Let me know any questions about it.

Kind regards,

Edgar.   

5,722 Views
miguel_reyes
NXP Employee
NXP Employee

Hello hagguisouhail‌, 

This support is already included in our latest SDK. Pleaso, download the new SDK released on 10th January with Bluetooth stack version 1.3.4. This provides support for OTA using FlexNVM. 

You can download the new SDK through the "mcuxpresso.nxp.com" web page. 

Best regards,

Miguel 

5,722 Views
hagguisouhail
Contributor III

Hello Miguel,

I integrated the new SDK into our project, however I noticed that I am not able any more to debug the project. Notice that I am using Jlink from Segger. Even when trying with the LPC-Link v2 on which I programed the CMSIS (with lpcscrypt), I fail to flash the program on the kw36 mcu. Can you help me with this issue please.

Best raegrds,

Souhail

0 Kudos
Reply

5,722 Views
miguel_reyes
NXP Employee
NXP Employee

Hi Souhail, 

Could you please ellaborate more about what is the issue you are seeing? We recommend to use CMSIS-DAP. Could you please also confirm that you are using MCUXpresso 10.3? This is needed to use latest drivers to support FlexNVM. 

Regarding SEGGER support, there has been a delay. We expect to get new drivers in one month.

Best regards,

Miguel 

0 Kudos
Reply

5,722 Views
hagguisouhail
Contributor III

Hi Miguel,

Allow me just to give you an overview to be more clear. We are working on a project that is based on the OTAP client example. Thus we have designed a new hardware based on mcu kw36 and we intend to program it via SWD JLINK or CMSIS-DAP. The first issue was the m_text memory exeecds the P-Flash section and you resolved that by adding the D-Flash section, with this modification we were able to program the kw36 only with the CMSIS-DAP interface of the LPC-Link v2, the Jlink didn't work with this modification and we were waiting for Segger to update their Jink driver. After that we have issue with OTA on two different memory bank, and you came up with one flash memory driver FTFE_2K_PD.cfx with the new SDK. I installed the new mcuxpresso 10.03 as you told me , before, I got the new software version of the LPC-Link v2 (Probe Firmware: LPC-LINK2 CMSIS-DAP V5.224) and I tried to flash the bootloader binary and otap application onto the kw36, Nevertheless I got an error and I am not able to resolve it.

I joined the error message that I got and here after you will find the consol log of the mcuxpresso.

Can you please verify with me this issue.

MCUXpresso IDE RedlinkMulti Driver v10.3 (Nov 28 2018 02:37:04 - crt_emu_cm_redlink build 748)
Found chip XML file in /home/haggui/Documents/test/frdmkw36_wireless_examples_framework_bootloader_otap_bm/Debug/MKW36Z512xxx4.xml
(  5) Remote configuration complete
Reconnected to existing link server
Connecting to probe 1 core 0 (using server started externally) gave 'OK'
============= SCRIPT: kinetisconnect.scp =============
Kinetis Connect Script
Connecting to Probe Index = 1
This probe = 1
This TAP = 0
This core = 0
DpID = 0BC11477
Assert NRESET
Reset pin state: 00
Power up Debug
MDM-AP APID: 0x001C0020
MDM-AP System Reset/Hold Reset/Debug Request
MDM-AP Control: 0x0000001C
MDM-AP Status (Flash Ready) : 0x00000032
Part is not secured
MDM-AP Control: 0x00000014
Release NRESET
Reset pin state: 01
MDM-AP Control (Debug Request): 0x00000004
MDM-AP Status: 0x0001003A
MDM-AP Core Halted
============= END SCRIPT =============================
Probe Firmware: LPC-LINK2 CMSIS-DAP V5.224 (NXP Semiconductors)
Serial Number:  I3FSF1MU
VID:PID:  1FC9:0090
USB Path: /dev/hidraw5
Using memory from core 0 after searching for a good core
debug interface type      = Cortex-M0+ (DAP DP ID 0BC11477) over SWD TAP 0
processor type            = Cortex-M0+ (CPU ID 00000C60) on DAP AP 0
number of h/w breakpoints = 2
number of flash patches   = 0
number of h/w watchpoints = 2
Probe(0): Connected&Reset. DpID: 0BC11477. CpuID: 00000C60. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Content of CoreSight Debug ROM(s):
RBASE F0002000: CID B105100D PID 000008E000 ROM (type 0x1)
ROM 1 F0000000: CID B105900D PID 04001BB932 CSt ARM MTB type 0x31 Trace Sink - Basic trace router
ROM 1 F0001000: CID B105900D PID 000008E000 CSt MTBDWT type 0x4 Debug Control - Other
ROM 1 E00FF000: CID B105100D PID 04000BB4C0 ROM (type 0x1)
ROM 4 E000E000: CID B105E00D PID 04000BB008 Gen SCS (type 0x0)
ROM 4 E0001000: CID B105E00D PID 04000BB00A Gen DWT (type 0x0)
ROM 4 E0002000: CID B105E00D PID 04000BB00B Gen FPB (type 0x0)
NXP: MKW36Z512xxx4
DAP stride is 1024 bytes (256 words)
Inspected v.2 On chip Kinetis Flash memory module FTFE_2K_PD.cfx
Image 'Kinetis SemiGeneric Oct 25 2018 11:59:14'
Opening flash driver FTFE_2K_PD.cfx
Sending VECTRESET to run flash driver
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 26/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 37/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 38/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x2000178C
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 73/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x2000178C
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 83/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 96/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 97/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 100/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 125/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 145/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 146/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 147/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x2000178C
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 155/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 172/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 173/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 174/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 194/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 209/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 222/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 223/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 224/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 237/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x2000178C
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 238/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x2000178C
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 260/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 294/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
flash driver polled mailbox (8 bytes at 0x20001788) read failed (on poll 300/301) - retrying after 1ms - rc Em(12). Target rejected debug access at location 0x20001788
Cannot halt processor
warning - failed to halt processor on startup timeout - rc Ep(04). Cannot halt processor.
Flash Driver V.2 startup failed - rc Ef(34): Timed-out initializing flash.
chip initialization failed - Ef(34): Timed-out initializing flash.
failed to initialize flash driver FTFE_2K_PD.cfxCapture du 2019-01-31 10-15-27.pngCapture du 2019-01-31 10-16-59.png

Best regards,

HAGGUI

0 Kudos
Reply

5,722 Views
EdgarLomeli
NXP Employee
NXP Employee

Hi Haggui

Did you try to perform a mass erase and unlock the chip before to program the OTAP bootloader?

Here are the steps to do it:

1-Change the OpenSDA firmware to J-Link version. Follow the steps in this post: FRDM-KW36: Update OpenSDA Firmware.

2-Open the J-Link Commander console. It is default located at C:\Program Files (x86)\SEGGER\<JLink_version>\JLink.exe

pastedImage_74.png

3-Type the command "connect". Then type "?" to select the device (MKW36Z512XXX4).

pastedImage_75.png

4-Select the SWD interface. Type "s". Then press "enter" again.

pastedImage_76.png

5-Type "erase" in the console. Then, type "unlock kinetis"

pastedImage_1.png

0 Kudos
Reply

5,722 Views
miguel_reyes
NXP Employee
NXP Employee

Hi hagguisouhail‌, 

We are looking into this issue. So, could you please let us know how did you programmed the bootloader binary? are you using the one from the latest release? 

Could you please use the JLink tool and see if you can connect with the KW36? I mean, run the JLink tool and be able to connect and unlock the device. Then, try to program a new application? We want to know if you are able to recover the part from the unknown state. 

Best regards,

Miguel 

0 Kudos
Reply

5,722 Views
miguel_reyes
NXP Employee
NXP Employee

Hi hagguisouhail‌, 

Could you please let us know if you still face issues on this? 

We are not able to reproduce the issue on our side. It would help if you can provide more details on the issue to investigate further. For example, check the reset line with an scope and see if device is reseting itself. Try to program the device using JLink instead of CMSIS-DAP. 

Please, let us know if there is any comment or question... 

Best regards,

Miguel 

5,722 Views
hagguisouhail
Contributor III

Thank you Miguel.

0 Kudos
Reply

5,728 Views
hagguisouhail
Contributor III

Finally I have been able to program the the Dflash section with the new SDK and the CMSIS-DAP interface. Since our hardware uses the JLink SWD, I was not able to flash the software within our hardware neither on the FRDM-KW36 eval board. Can you check with me what is the problem please? thank you.

0 Kudos
Reply

5,728 Views
miguel_reyes
NXP Employee
NXP Employee

Hi hagguisouhail‌,

Let me check on this one. So, you are using MCUXpresso IDE with a Jlink interface to program your board and you are not able to program D-flash(FlexNVM)? 

0 Kudos
Reply

5,728 Views
hagguisouhail
Contributor III

Hi Miguel,

Yes that is it.

0 Kudos
Reply

5,728 Views
miguel_reyes
NXP Employee
NXP Employee

It seems SEGGER tools are not supporting FlexNVM programming. I already submitted a ticket to them. 

We are waiting for their response. 

0 Kudos
Reply

5,728 Views
hagguisouhail
Contributor III

Hi Miguel,

Any apdates please from Segger ?

0 Kudos
Reply

5,728 Views
miguel_reyes
NXP Employee
NXP Employee

Hello hagguisouhail‌, 

I know there has been a while since talked about this request. We just got an update from SEGGER that they integrated the support of the FlexNVM in their JLink beta version V6.47a. You could find the release in the next link:

https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPackBeta

Using this beta software you should be able to flash the FlexNVM section of the KW36 device. 

Also, FRDM-KW36 OpenSDA SEGGER version was also updated. You could find it in the SEGGER web page. 

Best regards,

Miguel 

0 Kudos
Reply

5,728 Views
nsuresh2
Contributor III

Hello josem.reyes.chaidez‌,

kw36‌mcuxpresso 10.3.1 mcuxpresso ide and jlink segger jlink flexnvm 

Before the release of SEGEER JLink beta V6.47a, I have been programming KW36 FlexNVM with MCUXpresso IDE as mentioned in the below link:

https://community.nxp.com/docs/DOC-341634

Once after the program is compiled I used to download the code to KW36 using IAR Embedded workbench Download from file option using SEGEER JLink debugger.

Now once after the release of SEGEER JLink beta V6.47a, I could not able to modify the FlexNVM content which is previously written.

Can you share some detail steps to program or erase the KW36 FlexNVM using SEGGER JLink V6.47a using MCUXpresso IDE.

Thanks!

Regards,

Naven Suresh

0 Kudos
Reply

5,728 Views
EdgarLomeli
NXP Employee
NXP Employee

Hello nsuresh2@visteon.com‌,

There are the steps to update the J-Link drivers package in MCUXpresso IDE to handle the DFlash range address:

  1. Ensure that you have updated the OpenSDA firmware with the newest version. Go to the J-Link web site, scroll down and search for the J-Link OpenSDA - Board Specific Firmwares. Download the newest firmware for the FRDM-KW36. Also, download the beta version of the J-Link Software and Documentation Pack.
  2. Follow the steps described in this community post to update the OpenSDA firmware binary.
  3. Update to the newest version of MCUXpresso IDE.
  4. Open MCUXpresso, go to "Window -> Preferences". A new window will be shown. Go to "MCUXpresso IDE -> J-Link Options". Change the default JLinkGDBServerCL.exe path next to "J-Link Server executable text box", by the JLinkGDBServerCL.exe version included in the new beta pack that you have downloaded. The new path must be the following if you left the beta J-Link Software and Documentation Pack installation as default.pastedImage_2.png
  5. Try to program the device, and verify that the DFlash area is programmed or erased as you expect.

Please, tell us if this has solved your issue.

Best regards Naven.