cancel
Showing results for 
Search instead for 
Did you mean: 

[stm32l053r8]EEPROM HAL Driver Lib problem

ledinhtrunggaara
Associate
Posted on March 26, 2015 at 19:01

I try this simple code to get used to EEPROM HAL drivers library, but when i try to download the code to the board and start debugging with Keil, it appears ''cannot access target. Shut down debugging session'' and theni could not download the code to the board again as it says ''Internal Command Error'' (per my understanding it happens only when some pins relating debugging are changed ). I try full erase chip with with reset button and try which syntax cause that problem, and I found of it is due to this command
HAL_FLASHEx_DATAEEPROM_Program(TYPEPROGRAM_HALFWORD, add, data);
Can anyone help me understand this problem or it is a bug fromlibrary ?
THank you very much
volatile uint32_t data=35,a=0;<
br
>volatile uint32_t add = 0x08080000 ;<
br
>/* USER CODE END PV */<
br
><
br
><
br
>/* Private function prototypes -----------------------------------------------*/<
br
>void SystemClock_Config(void);<
br
><
br
><
br
>/* USER CODE BEGIN PFP */<
br
><
br
><
br
>/* USER CODE END PFP */<
br
><
br
><
br
>/* USER CODE BEGIN 0 */<
br
><
br
><
br
>/* USER CODE END 0 */<
br
><
br
><
br
>int main(void)<
br
>{<
br
><
br
><
br
> /* USER CODE BEGIN 1 */<
br
><
br
><
br
> /* USER CODE END 1 */<
br
><
br
><
br
> /* MCU Configuration----------------------------------------------------------*/<
br
><
br
><
br
> /* Reset of all peripherals, Initializes the Flash interface and the Systick. */<
br
> HAL_Init();<
br
><
br
><
br
> /* Configure the system clock */<
br
> SystemClock_Config();<
br
><
br
><
br
> /* Initialize all configured peripherals */<
br
> MX_GPIO_Init();<
br
> MX_TIM2_Init();<
br
><
br
><
br
> /* USER CODE BEGIN 2 */<
br
><
br
><
br
> /* USER CODE END 2 */<
br
><
br
><
br
> /* USER CODE BEGIN 3 */<
br
> /* Infinite loop */<
br
> while (1)<
br
> {<
br
><
span
class
=
''Apple-tab-span''
style
=
''white-space:pre''
> </
span
>HAL_FLASHEx_DATAEEPROM_Unlock();<
br
><
span
class
=
''Apple-tab-span''
style
=
''white-space:pre''
> </
span
>HAL_FLASHEx_DATAEEPROM_Program(TYPEPROGRAM_HALFWORD, add, data);<
br
><
span
class
=
''Apple-tab-span''
style
=
''white-space:pre''
> </
span
>HAL_FLASHEx_DATAEEPROM_Lock();

1 REPLY 1
Posted on March 26, 2015 at 19:54

Well that was totally unreadable, and lacking greater context.

Keil probably dumps out because the device sleeps or shuts down.

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