Commit 4ef82ea2 authored by Ramirez, Yvan's avatar Ramirez, Yvan
Browse files

Update README.md

parent f18ef9fd
......@@ -13,6 +13,12 @@ This is a BLE scanner example for the ST BluenrgMS, it shows the device and the
### Getting Started
### The easy way
Download the .Zip file or clone this repo to your computer, click on .cproject (you need to have [STM32 System Workbench](https://www.st.com/en/development-tools/sw4stm32.html) installed) and Voilà.
### The hard way (by yourself)
Open CubeMX, create a new project for the NUCLEO-L053 and configure the pinnouts as follow:
```
BLE_SCK - SPI1_SCK - PB3
......@@ -32,4 +38,55 @@ HCI_TL_INTERFACE - UserBoard
Utils - Selected
```
![Config image1](Images/Img1.PNG)
![Config image1](Images/Img2.PNG)
\ No newline at end of file
![Config image1](Images/Img2.PNG)
### Code
#### Prerequisites
First of all add the following code...
On main.h
```
/* Includes ------------------------------------------------------------------*/
#include "stm32l0xx_hal.h"
#include "hci_tl_interface.h"
#include "stm32l0xx_it.h"
```
On hci_tl_interface.h add this, on the Exported Defines comment
```
extern EXTI_HandleTypeDef hexti0;
#define H_EXTI_0 hexti0
```
#### printf Prototype
On main.c add these lines after the #includes
```
#ifdef __GNUC__
/* With GCC, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
```
Between /* USER CODE 4 BEGIN */ & /* USER CODE 4 END */ add
```
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
```
#### BLE app
Replace all the code on the generated app_x-cube-ble1.c to the one on this repo.
And you're done...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment