S32K344 C40 IP Hardware Fault Problem

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

S32K344 C40 IP Hardware Fault Problem

ソリューションへジャンプ
6,992件の閲覧回数
mesutkilicmak
Contributor II

Hi All,

I am trying to create custom bootloader app. I reserved 256KB space both bootloader app and parameters from the beginnig of the flash. I need to store boot parameters on the same block with the bootloader code. I tried to use C40 ip but, I am always getting HardFault error. As I learned from "AN13388-S32K3 Memories Guide" I can not write or erase same block while reading(code executing).

I tried some technics like ramcode and ITCM but, I could not be successful.

I do not want to use Data flash. Because HSE firmware uses all of it. 

What is the proper way to do that? Is there any example?

タグ(2)
0 件の賞賛
返信
1 解決策
6,975件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mesutkilicmak,

The below API functions have to be placed into SRAM (".ramcode" section), as show below.

  • C40_Ip_MainInterfaceSectorErase
  • C40_Ip_MainInterfaceSectorEraseStatus
  • C40_Ip_MainInterfaceWrite
  • C40_Ip_MainInterfaceWriteStatus

Then, the core must not access the block from interrupts. The interrupts must be either masked (PRIMASK = 1), or the vector table as well as the ISR() functions and the data the ISR() access must not be in the block.


C40_Ip.h.

Before the declaration:

#if ( 1 == C40_RAM_CODE_ENABLE
/* ram code start */
#define FLS_STOP_SEC_CODE
#include "Fls_MemMap.h"
#define FLS_START_SEC_RAMCODE
#include "Fls_MemMap.h"
#endif

After the declaration.

#if ( 1 == C40_RAM_CODE_ENABLE )
/* ram code end */
#define FLS_STOP_SEC_RAMCODE
#include "Fls_MemMap.h"
#define FLS_START_SEC_CODE
#include "Fls_MemMap.h"
#endif

if #define C40_RAM_CODE_ENABLE 1, the above four flash API functions are placed in the ".ramcode" section.

 

Regards,

Daniel

 

元の投稿で解決策を見る

5 返答(返信)
6,965件の閲覧回数
mesutkilicmak
Contributor II

Hi @danielmartynek 

Thank you for your answer. Your solution is worked for me.

In addition to your solution I also need to edit this function prototype too.

  • C40_Ip_MainInterfaceHVJobStatus

This function static in C40_Ip.c

I tried on C40 example. It worked fine but, does not worked my app. 

I removed the tick from "Fls Timeout Supervision Enabled" in C40_Ip. Because of the "OsIf_GetElapsed" function used.

I also need to move my functions that uses write and and erase to ramcode.

Regards,

Mesut

6,976件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mesutkilicmak,

The below API functions have to be placed into SRAM (".ramcode" section), as show below.

  • C40_Ip_MainInterfaceSectorErase
  • C40_Ip_MainInterfaceSectorEraseStatus
  • C40_Ip_MainInterfaceWrite
  • C40_Ip_MainInterfaceWriteStatus

Then, the core must not access the block from interrupts. The interrupts must be either masked (PRIMASK = 1), or the vector table as well as the ISR() functions and the data the ISR() access must not be in the block.


C40_Ip.h.

Before the declaration:

#if ( 1 == C40_RAM_CODE_ENABLE
/* ram code start */
#define FLS_STOP_SEC_CODE
#include "Fls_MemMap.h"
#define FLS_START_SEC_RAMCODE
#include "Fls_MemMap.h"
#endif

After the declaration.

#if ( 1 == C40_RAM_CODE_ENABLE )
/* ram code end */
#define FLS_STOP_SEC_RAMCODE
#include "Fls_MemMap.h"
#define FLS_START_SEC_CODE
#include "Fls_MemMap.h"
#endif

if #define C40_RAM_CODE_ENABLE 1, the above four flash API functions are placed in the ".ramcode" section.

 

Regards,

Daniel

 

1,752件の閲覧回数
Emguy
Contributor I

Please show sampel code how to place in c40 ip.h

 

0 件の賞賛
返信
6,841件の閲覧回数
WangLeiDevelopment
Contributor I

I find Bootloader project(unified_bootloader_demo_V2.1.exe) use C40_IP driver alsways run to hardware Falut . Then you uart for debug ,find program stoke at erase and write status (specific is inside  C40_Ip_Compare function is C40_Ip_SynchronizeCache)

0 件の賞賛
返信
6,816件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @WangLeiDevelopment,

Can you create a new thread for this issue?

 

Thanks,

BR, Daniel

0 件の賞賛
返信