-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LX_SYSTEM_INVALID_BLOCK #26
Comments
Hi, As this issue is specfic to STM32H7 could you fill an issue in the x-cube-azrtos-h7? regards |
I get a similar error in case of a sudden power failure.
Hardware:
Software: instance->lx_nor_flash_total_blocks = 8;
instance->lx_nor_flash_words_per_block = 4096 / 4; In the main loop, I write 512 byte blocks containing 128 bytes of 0xDA at the beginning, the rest of the area is 0x00. Blocks with indexes from 0 to 5 are filled in. for (uint32_t log_block = 0; log_block < 6; log_block++)
{
ret = _lx_nor_flash_sector_write(&nor_mem_desc, log_block, write_log_block);
if (ret != LX_SUCCESS)
{
break;
}
} I fixed the memory state after the INVALID_BLOCK error occurred. I am providing the bin file of the memory dump, perhaps this will help to understand the cause of the error. UPD: Additional info: Error block index: 5 UPD2: |
Hello,
I am trying to install FileX + LevelX in an stm32h7 microcontroller using a nor custom driver. I do have in my hardware an AT45DB641 NOR memory.
I am working it as an stand alone and also with fault tolerant enable.
My flash chip does have 4096 blocks of 2048 bytes each. i can write and read on pages of 256 bytes each.
Right now i am being able to format and open the media after doing a full reset of my chip, as i understand, putting everything to 1 (0xFF).
I can run the example that stm32 provide about creating a file etc...
My issue happens the second time i do run the code, but this time without erasing the chip.
I am getting following error from levelx: LX_SYSTEM_INVALID_BLOCK
and from filex: FX_IO_ERROR.
My code is as follows:
nor_custom_driver
#ifndef LX_DIRECT_READ
#ifndef NOR_SECTOR_BUFFER_SIZE
#define NOR_SECTOR_BUFFER_SIZE 512
#endif
static ULONG nor_sector_memory[NOR_SECTOR_BUFFER_SIZE];
#endif
UINT lx_stm32_nor_custom_driver_initialize(LX_NOR_FLASH *nor_flash)
{
UINT ret = LX_SUCCESS;
ULONG total_blocks = 0;
ULONG words_per_block = 0;
/* USER CODE BEGIN Init_Section_0 */
total_blocks = _45DBXX_ACTUALBLOCKS;
words_per_block = _45DBXX_BLOCKBYTES / sizeof(ULONG);
nor_flash->lx_nor_flash_base_address = _45DBXX_STARTADD;
/* USER CODE END Init_Section_0 */
nor_flash->lx_nor_flash_total_blocks = total_blocks;
nor_flash->lx_nor_flash_words_per_block = words_per_block;
/* USER CODE BEGIN Init_Section_1 */
/* USER CODE END Init_Section_1 */
nor_flash->lx_nor_flash_driver_read = lx_nor_driver_read;
nor_flash->lx_nor_flash_driver_write = lx_nor_driver_write;
nor_flash->lx_nor_flash_driver_block_erase = lx_nor_driver_block_erase;
nor_flash->lx_nor_flash_driver_block_erased_verify = lx_nor_driver_block_erased_verify;
#ifndef LX_DIRECT_READ
nor_flash->lx_nor_flash_sector_buffer = nor_sector_memory;
#endif
/* USER CODE BEGIN Init_Section_2 */
/* USER CODE END Init_Section_2 */
}
static UINT lx_nor_driver_write(ULONG *flash_address, ULONG *source, ULONG words)
{
UINT ret = LX_SUCCESS;
}
static UINT lx_nor_driver_block_erase(ULONG block, ULONG erase_count)
{
}
static UINT lx_nor_driver_block_erased_verify(ULONG block)
{
UINT ret = LX_SUCCESS;
}
UCHAR media_memory[512];
UCHAR media_buffer[512];
ULONG detected_errors;
UCHAR sratch_memory[4096];
/* Define FileX global data structures. */
FX_MEDIA nor_flash_disk;
FX_FILE fx_file;
ULONG fault_tolerant_memory[3072 / sizeof(ULONG)];
and my filex code is:
UINT MX_FileX_Init(VOID)
{
UINT ret = FX_SUCCESS;
/* USER CODE BEGIN MX_FileX_Init */
/* USER CODE END MX_FileX_Init */
/* Initialize FileX. */
fx_system_initialize();
/* USER CODE BEGIN MX_FileX_Init 1*/
/* USER CODE END MX_FileX_Init 1*/
return ret;
}
void MX_FileX_Process()
{
/* USER CODE BEGIN fx_app_thread_entry 0 */
UINT status;
ULONG available_space_pre;
ULONG available_space_post;
ULONG bytes_read;
CHAR read_buffer[32];
CHAR data[] = "This is FileX working on STM32";
uint8_t err = 0 ;
// BSP_LED_Toggle(LED_GREEN);
// tx_thread_sleep(40);
}
}
I really dont understand what is happening, i am even doing a direct read with my memory functions and i am seeing that the text and file name is present in the memory... is this something someone can help me with?
The text was updated successfully, but these errors were encountered: