Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: BlockErase with PFDL

$
0
0
Hello everyone, I'm currently trying to understand how to interact with the PFDL. All I tried so far is to erase a block. The hardware I'm doing my test on is the G14-StarterKit, it has a R5F104PJ. There are no compilation errors, section .DATA_DAT is fixed to 0x010000 (I do not really know why, but with that value the code compiled :/) and all I want to manipulate is the data flash (0xf1000 to 0xf2fff). The interesting parts should be: U16 flashEraseBlock(U16 block) {     pfdl_status_t status;     pfdl_request.command_enu = PFDL_CMD_ERASE_BLOCK;     pfdl_request.index_u16 = block;     status = PFDL_Handler();     status = PFDL_Execute(&pfdl_request);     while(status == PFDL_BUSY);         status = PFDL_Handler();     status = PFDL_Handler();     if(status == PFDL_OK)         return SUCCESS;     return FAILURE; } I tried to figure it out but I couldn't so far :/ At the moment this function is all I'm interested in. At first I thought the DataFlashLibrary has only access to the DataFlash area and therefore if I want to delete the first data flash block all I have to do, is to call my function with block = 0. The result was "No source available for Vectors() at 0x1b" and it looks like the first code flash block was erased. Then I set block = 17 because the microcontroller has 16 blocks of code flash and I thought the data flash is just concatenated. But it isn't. block = 17 results in the same error as block = 0. But at least i get some errors. Next i set block = 10 (and a bit later = 964) and with these values there isn't happen anything at all. All I get is "warning: Remote failure reply: E31 Remote failure reply: E31" nothing else. The system is dead. As mentioned before, all I try to do is initFlash(); flashEraseBlock(964); flashWrite(4, devicename, 0x1000); flashClose(); that's it. And for now I'm stuck a erasing a block. Any suggestions?

Viewing all articles
Browse latest Browse all 59170