Hi, I recently want to learn how to use LPC824(HVQFN33)'s I2C0 (Pin 8, Pin 9) as a SLAVE in an I2C device. I looked into the recommended learning resources in the forum and wanted to try out the functionality.(https://community.nxp.com/t5/LPC-Microcontrollers/Using-LPC824-as-I2C-Sensor-Hub/td-p/730664)
However, during the DEBUG Build, I encountered the error message "Linker CRP Enabled, but no CRP_WORD provided within application." There is no indication of the location, and I'm unsure how to proceed. Has anyone else encountered a similar issue?
Thanks.
Hi,
The CRP is invoked by programming a specific pattern in flash location at 0x0000 02FC for LPC82x.
For detailed inf, pls refer to section 25.5.3 Code Read Protection (CRP).
From software perspective, you can define the CRP in the startup_lpc804.c
#include <NXP/crp.h>
__CRP const unsigned int CRP_WORD = CRP_NO_CRP ;
////////////////////////////////////////////////////////
The CRP_NO_CRP is defined in the crp.h
#ifndef _CRP_H_INCLUDED_
#define _CRP_H_INCLUDED_
// A macro for placing data into the Code Read Protect (CRP) section,
// which is then located at the correct address for the selected MCU
// by the automatically generated linker script. The CRP section should
// contain a single 32-bit value which is the CRP value. See appropriate
// documentation for the MCU to determine CRP values.
//
// This feature is only available for NXP MCU targets with the Code Read
// Protect Feature
//
// Example:
// __CRP const uint32_t CRP_WORD = CRP_NO_CRP ;
//
#define __CRP __attribute__ ((used,section(".crp")))
#define CRP_NO_CRP 0xFFFFFFFF
// Disables UART and USB In System Programming (reads and writes)
// Leaves SWD debugging, with reads and writes, enabled
#define CRP_NO_ISP 0x4E697370
// Disables SWD debugging & JTAG, leaves ISP with with reads and writes enabled
// You will need UART connectivity and FlashMagic (flashmagictool.com) to reverse
// this. Don't even try this without these tools; most likely the SWD flash
// programming will not even complete.
// Allows reads and writes only to RAM above 0x10000300 and flash other than
// sector 0 (the first 4 kB). Full erase also allowed- again only through UART
// and FlashMagic (NO JTAG/SWD)
#define CRP_CRP1 0x12345678
// Disables SWD debugging & JTAG, leaves UART ISP with with only full erase
// enabled. You must have UART access and FlashMagic before setting this
// option.
// Don't even try this without these tools; most likely the SWD flash
// programming will not even complete.
#define CRP_CRP2 0x87654321
/************************************************************/
/**** DANGER CRP3 WILL LOCK PART TO ALL READS and WRITES ****/
#define CRP_CRP3_CONSUME_PART 0x43218765
/************************************************************/
Hope it can help you
BR
XiangJun Rong