cancel
Showing results for 
Search instead for 
Did you mean: 

how to erase stm32f030k6t6 ? after I have program ic PA13 and PA14 set as input pin. now I can't erase or debug with stlink swd . please help thanks

Mrohi
Associate III

how to erase or program using by st cube ide stm32f030k6t6 ? after I have program ic PA13 and PA14 set as input pin. now I can't erase or debug with stlink swd . please help thanks

21 REPLIES 21

Pull BOOT0 HIGH so *your* code doesn't run

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Mrohi
Associate III

first many thanks you are 100% right. I have finally i erase and new program fallow your instruction . last week problem with my stlink debugger pin lose contact . that's why error device not found. finally thanks now I can use this two pin as output.

Thanks Clive
Now I can program and erase very easily last week problem with my stlink debugger .
Many thanks
Mrohi
Associate III

dear Clive

I need your help for store int data to flash memory . I am working on stm32f030k6t6.

please help me.

thanks.

What like static const int array[] = { 1, 2, 3, 4, 5 }; ??

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Mrohi
Associate III

yes dear Clive this my code and SETV is global veriable uint16_t. uint16_t SETV = 0 ;

I need to store this value in SETV after setting by user key up and dn.

in my circuit have 3 input key (1) UP (2) DN (3) SET.

UP key AND DN key is setting up and down and SET key is for store data in flash.

I don't know the sectors number in stm32f030k6t6.where to store and I don't know erase ,read write HAL instruction function

please help me thanks a lot.

I need to store value 0000 to 9999 .

/////-----------------------INTERUPT FUNCTION FOR SET KEY UP +1 AND -1 DN --------------------------

  void KEY (void)

  {

  if (HAL_GPIO_ReadPin(UP_GPIO_Port,UP_Pin)) /// press. up key +1

   {

  SETV = SETV +1;

   LD2ON;

       DT10;

            }

   else

  {

       LD2OFF;

   //INV = ADV1 ;

  }

  if (HAL_GPIO_ReadPin(DN_GPIO_Port,DN_Pin)). /// press down key for -1

    {

    SETV = SETV -1;

     LD2ON;

     DT10;

    }

     else

    {

     //INV = ADV1 ;

    LD2OFF;

           }

  }

///--------------------------------------- END INTRUPT KEY FUNCTION ---------------------------------------------------------------

I'd imagine much of the specifics for the part are covered in the Data Sheet or Reference Manual. I'd probably use the last sector at the end of memory, and shrink the size available to the linker. You'll need to fetch the value from memory rather that use a static definition for the value in the code.

STM32Cube_FW_F0_V1.10.1\Projects\STM32F030R8-Nucleo\Examples\FLASH\FLASH_EraseProgram     

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Mrohi
Associate III

dear Clive first thank you very much for help.

I try to understand erase and read in reference manual near 2 hour but I can't understand .

specially erase syntax line.please can you tell me where is clear I can understand .

if you tell me 2 or 3 line example I will be oblige .

thank you very much