We using the MIMXRT1064CVL5B in our design, we facing the some problem in software development. please conform why Hard Fault error come, its based on Hardware design? how to solve it, please help me.
We need your help regarding the above, please help us as soon as possible.
Regards,
Sakthi,
Embedded Hardware Engineer,
RGBSI,
Bangalore.
Hi thanks for your replied, we used customized our source code but hard fault problem solved. we facing some other problem now.
Microcontroller: iMXRT1064
In our custom board, we are using most of the boot configuration pins for other functionalities like I2C, SPI, and GPIO inputs with pullups.
During the boot, the state of these pins affects the normal boot.
From the reference manual, we came to know that, we can set the BT_FUSE_SEL eFuse to override the boot configuration pins.
Our custom board doesn't have a USB interface to configure the eFuses.
We found an alternative from the NXP's forum, to burn the fuses using OCOTP. We used the following code. When we read the fuse address 0x460, we are getting the value 0x00000010. But still the state of boot config GPIOs affects the boot.
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_ocotp.h"
#include "fsl_debug_console.h"
#define EXAMPLE_OCOTP_SHADOW_REGISTER_READ_ENABLE 1U
#define EXAMPLE_OCOTP_SHADOW_REGISTER_WRITE_ENABLE 0U
#if EXAMPLE_OCOTP_SHADOW_REGISTER_READ_ENABLE || EXAMPLE_OCOTP_SHADOW_REGISTER_WRITE_ENABLE
#ifndef EXAMPLE_OCOTP_FUSE_MAP_ADDRESS
#define EXAMPLE_OCOTP_FUSE_MAP_ADDRESS 0x460
#endif
#ifndef EXAMPLE_OCOTP_FUSE_WRITE_VALUE
#define EXAMPLE_OCOTP_FUSE_WRITE_VALUE 0x00000010
#endif
#endif
int main(void)
{
uint32_t version;
/* Init hardware*/
BOARD_ConfigMPU();
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitDebugConsole();
PRINTF("OCOTP Peripheral Driver Example\r\n\r\n");
#if (defined(FSL_FEATURE_OCOTP_HAS_TIMING_CTRL) && FSL_FEATURE_OCOTP_HAS_TIMING_CTRL)
OCOTP_Init(OCOTP, EXAMPLE_OCOTP_FREQ_HZ);
#else
OCOTP_Init(OCOTP, 0U);
#endif
/* Get the OCOTP controller version. */
version = OCOTP_GetVersion(OCOTP);
PRINTF("OCOTP controller version: 0x%08X\r\n\r\n", version);
#if EXAMPLE_OCOTP_SHADOW_REGISTER_READ_ENABLE || EXAMPLE_OCOTP_SHADOW_REGISTER_WRITE_ENABLE
status_t status = kStatus_Success;
uint32_t fuseData = 0U;
status = OCOTP_ReadFuseShadowRegisterExt(OCOTP, EXAMPLE_OCOTP_FUSE_MAP_ADDRESS, &fuseData, 1);
if (status != kStatus_Success)
{
PRINTF("Could not read fuse data\r\n");
while (1)
;
}
PRINTF("The origin value of fuse address 0x%02X is 0x%08X\r\n", EXAMPLE_OCOTP_FUSE_MAP_ADDRESS, fuseData);
#endif
#if EXAMPLE_OCOTP_SHADOW_REGISTER_WRITE_ENABLE
status = OCOTP_WriteFuseShadowRegister(OCOTP, EXAMPLE_OCOTP_FUSE_MAP_ADDRESS, EXAMPLE_OCOTP_FUSE_WRITE_VALUE);
if (kStatus_Success == status)
{
PRINTF("OCOTP Write operation success!\r\n");
status = OCOTP_ReadFuseShadowRegisterExt(OCOTP, EXAMPLE_OCOTP_FUSE_MAP_ADDRESS, &fuseData, 1);
if (status != kStatus_Success)
{
PRINTF("Could not read fuse data\r\n");
while (1)
;
}
PRINTF("The new value is 0x%08X\r\n", fuseData);
}
else
{
PRINTF("OCOTP write operation failed. Access deny!\r\n");
}
#endif
while (1)
{
}
}
Which code will cause hardfault? your application only or any example from SDK?