This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NAND MT29F1G08ABBDAH4 don't works

Hi all.

NAND MT29F1G08ABBDAH4 + Cortex m4 at Keenetis K70f15 dont' works.

I've began to use mdk473 instead of mdk503 after conversation with Keil support team. Purpose is still the same - to mount File System on NAND flash and to read/to write some files.

What did I do, step-by-step:

1. An empty project was created.

2. Some files were added: startup_MK70F15.s, system_MK70F15.c, main.c nand_mk70.c, nand_mk70.h, file_config.c FS_CM3.lib

3. startup_MK70F15.s was configured: HeapSize was set to 0x1300 (up to 8 files), StackSize was set to 0x400.

4. File_config.c was configured: PageSize was set to 2112 and DefaultDrive flag was set, Nand0 flag was enabled

5. The project was compiled = OK

All the functions(Init, UnInit, Erase, PageRead and PageWrite) are exists in nand_mk70.c, defined and compiled.

Here is all the code, which I'm trying to run.

#include <rtl.h>
#include <stdio.h>
int main(){
if (finit (NULL) != 0) {
printf ("Initialization failed.\n");
printf ("The drive is not enabled in the file 'File_Config.h'\n");
}
while(1);
return 0;

}

But program doesn't starts and goes to infinite loop before main(), at _sys_open, asm:

_sys_open:
0x00001010 B50E PUSH {r1-r3,lr}
0x00001012 E9CD0100 STRD r0,r1,[sp,#0]
0x00001016 F7FFFE75 BL.W strlen (0x00000D04)
0x0000101A 9002 STR r0,[sp,#0x08]
0x0000101C 4669 MOV r1,sp
0x0000101E 2001 MOVS r0,#0x01
0x00001020 BEAB BKPT 0xAB
0x00001022 BD0E POP {r1-r3,pc}

at highlighted line.

When I comment "finit()" everything is OK, any another code works fine.
What the problem could be there?
It seems I've missed something very important, but what exactly?

  • Do you have some putchar/printf code some place else (SystemInit for CMSIS)? Have you implemented any sort of semi-hosting for the serial output of your board. The BKPT suggests it's trying to call OS hosting functions you're not supplying.

  • No, I have no putchar/printf code somewhere else.

    The project is modified example from ..\ARM\Boards\Freescale\TWR-K70F120M\RL\FlashFS\NAND_File\

    There were some printf/putchar code, but i cut it out and removed all the implementation from retarget.c. Serial.h and getline.c are also removed. All the code uses string constants instead of IO functions.

    Can you advice me a cup of docs about BKPT, etc.?