lpcware

Spifi library problem: reading from invalid address

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by hlsa on Tue Sep 03 22:27:04 MST 2013
Since I have not received an answer regarding a spifi problem in the peripherals forum (see http://www.lpcware.com/content/forum/spifi-library-non-keil-development), I will give it another try here.

The problem is quite simple: the SPIFI-library does not work.


Here is my code:
void FvSpifiInit(void)
{
int32_t ret = 0;

LPC_SCU->SFSP3_3 = SSP_IO | 3; /* P3_3: SPIFI_SCLK */
LPC_SCU->SFSP3_4 = SSP_IO | 3; /* P3_4: SPIFI_IO3 */
LPC_SCU->SFSP3_5 = SSP_IO | 3; /* P3_5: SPIFI_IO2 */
LPC_SCU->SFSP3_6 = SSP_IO | 3; /* P3_6: SPIFI_IO1 */
LPC_SCU->SFSP3_7 = SSP_IO | 3; /* P3_7: SPIFI_IO0 */
LPC_SCU->SFSP3_8 = SSP_IO | 3; /* P3_8: SPIFI_/CS */

/* Enable clock source for SPIFI */
LPC_CGU->BASE_SPIFI_CLK = 1<<24 | 1<<11; /* clock source IRC 12 MHz */

ret = pSpifi->spifi_init(&obj, 3, S_RCVCLK | S_FULLCLK, 12);
}

pSpifi points correctly to spifi_table, which is linked into my program code (0x1a035198). The spifi functions from the library are also correctly linked into the program (e.g. spifi_init at 0x1a01309c).

During linking, I get the following warning:
ld.exe: warning: C:\T\IPD10G2\M4\Bsp\Cmsis\spifi_drv_M4.lib(spifi_rom_api.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail

Running the program ends in an exception.
I debugged the assembler code of the spifi library: in the init function a ldr-Instruction loads data from 0x29004018 (see screenshot), which is obviously an invalid address.

I use the library which is mentioned above (file size: 35468 bytes). My controller is a LPC4357.

What's going wrong?

Best regards,
Holger

Attachments

Outcomes