Skip to content

New board Discovery L475VG IOT #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from Sep 13, 2017
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Arduino core support for STM32 based boards
# Arduino core support for STM32 based boards
### Latest release [![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Core_STM32.svg)](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)
[![GitHub commits](https://img.shields.io/github/commits-since/stm32duino/Arduino_Core_STM32/2017.8.31.svg)](https://github.com/stm32duino/Arduino_Core_STM32/compare/2017.8.31...master)

Expand All @@ -8,7 +8,7 @@

## Getting Started

This repo is available as a package usable with [Arduino Boards Manager](https://www.arduino.cc/en/guide/cores).
This repo is available as a package usable with [Arduino Boards Manager](https://www.arduino.cc/en/guide/cores).

For full instructions on using the "**Boards Manager**", see the [Getting Started](https://github.com/stm32duino/wiki/wiki/Getting-Started) page.

Expand Down Expand Up @@ -50,6 +50,7 @@ For advanced user, you can use the repository: see the [Using git repository](ht
* STM32L4
* [Nucleo L432KC](http://www.st.com/en/evaluation-tools/nucleo-l432kc.html)
* [Nucleo L476RG](http://www.st.com/en/evaluation-tools/nucleo-l476rg.html)
* [B-L475E-IOT01A](http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html)

## Troubleshooting

Expand Down
14 changes: 14 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@ Disco.menu.board_part_num.DISCO_F746NG.build.product_line=STM32F746xx
Disco.menu.board_part_num.DISCO_F746NG.build.variant=DISCO_F746NG
Disco.menu.board_part_num.DISCO_F746NG.build.cmsis_lib_gcc=arm_cortexM7l_math

# DISCO_L475VG_IOT board
# Support: USB HID, Serial1 (USART1 on PA1, PA0)
Disco.menu.board_part_num.DISCO_L475VG_IOT=STM32L475VG-DISCOVERY-IOT
Disco.menu.board_part_num.DISCO_L475VG_IOT.node=DIS_L4IOT
Disco.menu.board_part_num.DISCO_L475VG_IOT.upload.maximum_size=1048576
Disco.menu.board_part_num.DISCO_L475VG_IOT.upload.maximum_data_size=98304
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.mcu=cortex-m4
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.f_cpu=80000000L
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.board=DISCO_L475VG_IOT
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.series=STM32L4xx
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.product_line=STM32L475xx
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.variant=DISCO_L475VG_IOT
Disco.menu.board_part_num.DISCO_L475VG_IOT.build.cmsis_lib_gcc=arm_cortexM4l_math

# Upload menu
Disco.menu.upload_method.MassStorageMethod=Mass Storage
Disco.menu.upload_method.MassStorageMethod.upload.protocol=
Expand Down
3 changes: 3 additions & 0 deletions cores/arduino/stm32/PeripheralPins.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@ extern const PinMap PinMap_CAN_TD[];
//*** ETHERNET ***
extern const PinMap PinMap_Ethernet[];

//*** QUADSPI ***
extern const PinMap PinMap_QUADSPI[];

#endif

2 changes: 2 additions & 0 deletions cores/arduino/stm32/usbd_hid_composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ __ALIGN_BEGIN static uint8_t HID_KEYBOARD_ReportDesc[HID_KEYBOARD_REPORT_DESC_SI
static uint8_t USBD_HID_Init (USBD_HandleTypeDef *pdev,
uint8_t cfgidx)
{
UNUSED(cfgidx);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's ok, but why do you remove them ? can you explain in commit message ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removed only function parameters not used inside the function. There is no impact on the rest of the code but allow to remove some warning messages at compilation time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sorry - this is clear enough in the commit title already !

uint8_t ret = 0;

/* Open EP IN */
Expand Down Expand Up @@ -407,6 +408,7 @@ static uint8_t USBD_HID_Init (USBD_HandleTypeDef *pdev,
static uint8_t USBD_HID_DeInit (USBD_HandleTypeDef *pdev,
uint8_t cfgidx)
{
UNUSED(cfgidx);
/* Close HID EPs */
USBD_LL_CloseEP(pdev,
HID_MOUSE_EPIN_ADDR);
Expand Down
25 changes: 25 additions & 0 deletions libraries/SPI/src/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,31 @@ void SPIClass::transfer(uint8_t _pin, void *_buf, size_t _count, SPITransferMode
digitalWrite(_pin, HIGH);
}

void SPIClass::transfer(byte _pin, void *_bufout, void *_bufin, size_t _count, SPITransferMode _mode)
{
if ((_count == 0) || (_bufout == NULL) || (_bufin == NULL) || (_pin > NUM_DIGITAL_PINS))
return;

if(_pin != _CSpin) {
uint8_t idx = pinIdx(_pin, GET_IDX);
if(idx == NB_SPI_SETTINGS) {
return;
}
spi_init(&_spi, spiSettings[idx].clk,
spiSettings[idx].dMode,
spiSettings[idx].msb);
_CSpin = _pin;
}

if((_pin != CS_PIN_CONTROLLED_BY_USER) && (_spi.pin_ssel == NC))
digitalWrite(_pin, LOW);

spi_transfer(&_spi, ((uint8_t*)_bufout), ((uint8_t*)_bufin), _count, SPI_TRANSFER_TIMEOUT);

if((_pin != CS_PIN_CONTROLLED_BY_USER) && (_mode == SPI_LAST) && (_spi.pin_ssel == NC))
digitalWrite(_pin, HIGH);
}

void SPIClass::attachInterrupt(void) {
// Should be enableInterrupt()
}
Expand Down
6 changes: 6 additions & 0 deletions libraries/SPI/src/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class SPIClass {
byte transfer(uint8_t pin, uint8_t _data, SPITransferMode _mode = SPI_LAST);
uint16_t transfer16(uint8_t pin, uint16_t _data, SPITransferMode _mode = SPI_LAST);
void transfer(uint8_t pin, void *_buf, size_t _count, SPITransferMode _mode = SPI_LAST);
void transfer(byte _pin, void *_bufout, void *_bufin, size_t _count, SPITransferMode _mode = SPI_LAST);

// Transfer functions when user controls himself the CS pin.
byte transfer(uint8_t _data, SPITransferMode _mode = SPI_LAST)
Expand All @@ -131,6 +132,11 @@ class SPIClass {
transfer(CS_PIN_CONTROLLED_BY_USER, _buf, _count, _mode);
}

void transfer(void *_bufout, void *_bufin, size_t _count, SPITransferMode _mode = SPI_LAST)
{
transfer(CS_PIN_CONTROLLED_BY_USER, _bufout, _bufin, _count, _mode);
}

// Transaction Functions
void usingInterrupt(uint8_t interruptNumber);

Expand Down
Loading