Flashing S32K144 devices over SWD

Showing results for 
Search instead for 
Did you mean: 

Flashing S32K144 devices over SWD

Contributor I


I am developing a design where one S32K144 chip is interfaced. The design has another main processor interfaced.

I have configured two gpios of this primary processor as SWD_CLK and SWD_IO, and currently trying to program the S32K144 board using SWD interface.

I got initial success in interfacing S32K144 chip over SWD via gpio-bit-banging. I am able to access the MDM-AP port and its functionalities such as

- Read MDM-AP ID register

- Mass erase the chip

- Put the core into halt state.

Now I want to flash a hex file into the board by SWD interface.

For S32K devices, are there any in-detail steps or similar reference to perform flashing .hex file using AHB-AP over SWD?

I am looking for steps which fulfill:-

- Flash a .hex file in program flash (in the similar way flash in jflashlite using JLink).

- Verify(by Read Back or similar mechanism) that .hex file is flashed correctly.

- Eliminate chances of enabling the "flash protection" while performing above two procedure.

I referred "Document Number: AN12130" and reference documents under its "further reading" section. But it seems incomplete for providing the detailed steps for flashing algorithm of S32K devices.

Thanks in advance!

Labels (1)
0 Kudos
2 Replies

Contributor I

Excuse me, is your problem solved?
The instructions in the screenshot are how to operate.


0 Kudos

NXP TechSupport
NXP TechSupport

Hello Nirav Khatri,

Based on the information you provided I understood that you are trying to implement your own programmer. Unfortunately, we don't have any examples or step by step guide that shows how to achieve this, and the implementation of this it's out of our scope.


The flash technology that is used in S32K family is confidential, this is why we don't have detailed documentation. But the reference manual has a chapter Flash Memory Module (FTFC), which tells you the utilization of  flash in detail: how to set the flash clock, how to erase sector or mass erase, how to program a sector, how to set the EEPROM mode for some chips, how to read a cell, how to set security mode to avoid the flash contents is read via jtag illegally, among other things. The information stated in this chapter it's enough to manipulate flash to achieve what you are looking for. Please refer to chapter 36, Flash Memory Module (FTFC) of the reference manual.


To eliminate chances of enabling the flash protection you won't have any problem, just don't modify the registers FPROT0 - FPROT3.

Have a great day,

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.