cancel
Showing results for 
Search instead for 
Did you mean: 

DFU status response for STM32CubeProg

JWu.2
Associate II

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

4 REPLIES 4
JWu.2
Associate II

Hello, can anyone help me?

Houda GHABRI
ST Employee

Hi@JWu.2 ,

Can you tell me wich MCU and CubeProgrammer version are you using?

regards,

Houda

JWu.2
Associate II

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

JWu.2
Associate II

Hi @Houda GHABRI​ ,

did you find any thing? or you need more information?