2020-03-19 12:44 AM
Hi,
I've create my own bootloader with USB DFU functionality. (I need some function that built-in bootloader can't provide)
I'm able to read/write/erase application firmware by USB DFU now.
however, I find the STM32CubeProg work differently with built-in and my bootloader.
with my bootloader, STM32CubeProg will not display the information of sections, and it took more time to sync with device.
I'm wondering did I missed something?
I think the problem might be the response from MEM_If_GetStatus_FS function.
I've seen some example on the internet:
#define FLASH_PROGRAM_TIME (uint16_t)50
#define FLASH_ERASE_TIME (uint16_t)50
uint16_t MEM_If_GetStatus_FS(uint32_t Add, uint8_t Cmd, uint8_t *buffer)
{
/* USER CODE BEGIN 5 */
switch (Cmd)
{
case DFU_MEDIA_PROGRAM:
buffer[0] = (uint8_t)FLASH_PROGRAM_TIME;
buffer[1] = (uint8_t)(FLASH_PROGRAM_TIME >> 8);
buffer[2] = 0;
break;
case DFU_MEDIA_ERASE:
buffer[0] = (uint8_t)FLASH_ERASE_TIME;
buffer[1] = (uint8_t)(FLASH_ERASE_TIME >> 8);
buffer[2] = 0;
default:
break;
}
return (USBD_OK);
/* USER CODE END 5 */
}
but with these codes, STM32CubeProg says"Warning: Device is under Read Out Protection".
does any know what is the correct response from MEM_If_GetStatus_FS call-back function?
I've read every document I could find, but I didn't find the description for these bytes.
Best Regards.
Jerry
2020-03-26 05:55 PM
Hello, can anyone help me?
2020-03-27 03:37 AM
Hi@JWu.2 ,
Can you tell me wich MCU and CubeProgrammer version are you using?
regards,
Houda
2020-03-29 06:26 PM
Hi @Houda GHABRI,
thanks for helping me.
I'm currently using V2.4.0 (I download it two weeks ago.)
I also tried V2.2.0 and V2.3.0, and I got similar result.
I tested the sample project "DFU_Standalone" in STM32Cube_FW_F0_V1.11.0, the result is same to my bootloader.
Best Regards.
Jerry
2020-05-03 06:36 PM
Hi @Houda GHABRI ,
did you find any thing? or you need more information?