Skip to content
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

New board Discovery L475VG IOT #97

Merged
merged 11 commits into from Sep 13, 2017
Merged

New board Discovery L475VG IOT #97

merged 11 commits into from Sep 13, 2017

Conversation

ghost
Copy link

@ghost ghost commented Sep 4, 2017

Add source files for the variant DISCO_L475VG_IOT.

The following on board peripherals are available:

  • USB OTG FS (native)
  • Flash memory (MX25R6435F library required)
  • Bluetooth V4.1 module (SPBTLE-RF library required)
  • Microphones (MP34DT01 library required)
  • Humidity and temperature sensor (HTS221 library required)
  • Magnetometer (LIS3MDL library required)
  • Accelerometer and gyroscope (LSM6DSL library required)
  • Barometer (LPS22HB library required)
  • Time of flight and gesture detection sensor (VL53L0X library required)

The following on board peripherals will be available later:

  • WiFi
  • NFC
  • Sub-GHz RF

Copy link
Member

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

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

Question: where do the change from commit "Update USB configuration" come from and what are they fixing ?

@fpistm fpistm self-requested a review September 4, 2017 13:01
@ghost
Copy link
Author

ghost commented Sep 4, 2017

@LMESTM

the change from commit "Update USB configuration" adapt the usb files from the previous commit (original source files from STM32Cube) for the Arduino project.

Copy link
Member

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

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

Few comments and questions but overall looks like a good PR - thanks for it !!

@@ -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 !

RCC_OscInitStruct.PLL.PLLN = 40;
RCC_OscInitStruct.PLL.PLLP = 7;
RCC_OscInitStruct.PLL.PLLQ = 4;
RCC_OscInitStruct.PLL.PLLR = 4;
Copy link
Member

Choose a reason for hiding this comment

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

Does the change have an impact on the CPU or main peripheral clocks ?
Typically do we still have CPU running @ 80MHz ?

Copy link
Author

Choose a reason for hiding this comment

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

This modification do not impact the main clock. It's still running at 80MHz.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -76,7 +76,7 @@ enum {

//SPI definitions
//define 16 channels. As many channel as digital IOs
#define SPI_CHANNELS_NUM 16
#define SPI_CHANNELS_NUM DEND
Copy link
Member

Choose a reason for hiding this comment

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

Can you be more verbose in the commit message concerning this fix ?
Does it only apply to this new board ?

@@ -24,6 +24,8 @@
extern "C" {
#endif

#include "clock.h"
Copy link
Member

Choose a reason for hiding this comment

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

Which compilation error does it fix ? And why is this visible only with this new board ?
Arduino.h is where wiring.h is included from and it first includes<chip.h> that should contain necessary defines.
Maybe the error should be corrected somewhere else ... depends on the actual error

Copy link
Author

Choose a reason for hiding this comment

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

It fixes a compilation error in the library SPBTLE-RF because we call wiring.h and without the fix it doesn't find some function of clock.h.
I tried to use Arduino.h but I had more compilation errors due to missing prototypes.
Maybe there is another solution that could be implemented in the library and not in the core. I will continue to look for.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I also think it is better to solve the library side and find the proper includes from the library

Copy link
Member

Choose a reason for hiding this comment

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

This include is missing in the core and is required.
Wiring.h declare a static function which use GetCurrentMicro() define in clock.h.
Already see this issue in my test_usb branch on my forked repo.

Copy link
Author

@ghost ghost Sep 4, 2017

Choose a reason for hiding this comment

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

So I will leave it and we will use it as a fix.

Copy link
Member

Choose a reason for hiding this comment

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

OK @fpistm is the boss :-)

Copy link
Member

Choose a reason for hiding this comment

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

Boss_Baby
But I can be wrong...

@fpistm fpistm added enhancement New feature or request new variant Add support of new bard labels Sep 4, 2017
@fpistm fpistm added this to the Next release milestone Sep 4, 2017
// {PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5 - D1/UART4_TX
// {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 - D0/UART4_RX
// {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 - D0/UART4_RX
// {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 - D10/PWM
Copy link
Member

Choose a reason for hiding this comment

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

why not allowing ADC on D10?

// {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 - D0/UART4_RX
// {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 - D10/PWM
// {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 - D10/PWM
// {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 - D4
Copy link
Member

Choose a reason for hiding this comment

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

ditto for D4

// {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 - D10/PWM
// {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 - D4
// {PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 - D4
// {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 - D7
Copy link
Member

Choose a reason for hiding this comment

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

ditto for D7

// {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 - D7
// {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 - D13/SPI1_SCK/LED1
// {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 - D13/SPI1_SCK/LED1
// {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 - D12/SPI_MISO
Copy link
Member

Choose a reason for hiding this comment

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

ditto D12

// {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 - D13/SPI1_SCK/LED1
// {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 - D12/SPI_MISO
// {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 - D12/SPI_MISO
// {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 - D11/SPI1_MOSI/PWM
Copy link
Member

Choose a reason for hiding this comment

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

ditto D11

//*** PWM ***

#ifdef HAL_TIM_MODULE_ENABLED
const PinMap PinMap_PWM[] = {
Copy link
Member

Choose a reason for hiding this comment

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

same for ADC, why PWM could not be available for D4, D13, D12, D14, D15, ...?

#define USBD_MANUFACTURER_STRING "Unknown"
#endif /* USBD_VID */
#ifdef USBD_USE_HID_COMPOSITE
#define USBD_HID_PRODUCT_FS_STRING "HID in FS Mode"
Copy link
Member

Choose a reason for hiding this comment

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

#define LED1 LED_BUILTIN
#define LED2 16
#define LED3 41
#define LED4 LED3
Copy link
Member

Choose a reason for hiding this comment

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

Is LED4 definition really needed?

Copy link
Author

Choose a reason for hiding this comment

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

LED4 is defined to match with the documentation and the PCB serigraphy.

Copy link
Member

Choose a reason for hiding this comment

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

Yes I've saw it. one refers to WiFI and the other to BLE. depending of the gpio state.

Copy link
Author

Choose a reason for hiding this comment

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

In conclusion do we keep it?

Copy link
Member

Choose a reason for hiding this comment

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

Yes as the name is used.


//SPI definitions
//define 16 channels. As many channel as digital IOs
#define SPI_CHANNELS_NUM PEND
Copy link
Member

Choose a reason for hiding this comment

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

This change should be populated to all variants ?

Copy link
Author

Choose a reason for hiding this comment

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

Yes it should. I will update the other variants.

Copy link
Member

@fpistm fpistm Sep 6, 2017

Choose a reason for hiding this comment

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

Pleaser use NUM_DIGITAL_PINS instead of PEND

#define SS3 8
#define MOSI 11
#define MISO 12
#define SCLK 13
Copy link
Member

Choose a reason for hiding this comment

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

Remove SCLK definition
#define SCK 13
Refer to ebe46ff

// {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - D12/SPI_MISO
// {PA_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 0)}, // TIM17_CH1 - D11/SPI1_MOSI/PWM
{PA_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 0)}, // TIM17_CH1 - D11/SPI1_MOSI/PWM
Copy link
Member

Choose a reason for hiding this comment

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

Only one PA_7 should be define

@@ -40,25 +40,25 @@

#ifdef HAL_ADC_MODULE_ENABLED
const PinMap PinMap_ADC[] = {
// {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 - D1/UART4_TX
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 - D1/UART4_TX
Copy link
Member

Choose a reason for hiding this comment

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

Then It misses the Ax definition in variant.*

@VVESTM VVESTM self-requested a review September 6, 2017 08:42
@VVESTM
Copy link
Contributor

VVESTM commented Sep 11, 2017

Hi,
I have executed our test plan on this pull request. All tests are OK, good.

To reduce again the number of commits, a merge can be done with d24a022 and 3af2d2a

Vincent

@ghost
Copy link
Author

ghost commented Sep 11, 2017

Hi @VVESTM

Thank you. Merge done.

fpr added 8 commits September 12, 2017 15:39
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
…75E-IOT01/Applications/USB_Device

Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
…SB Audio class)

Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
@fpistm
Copy link
Member

fpistm commented Sep 12, 2017

Think to update the Readme.md with the new board

Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
@ghost ghost requested a review from fpistm September 13, 2017 11:32
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

Ok. Please update the Readme.md with the new board then it could be merged.

Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
@ghost ghost requested a review from fpistm September 13, 2017 12:39
@VVESTM VVESTM merged commit 1ae377b into stm32duino:master Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new variant Add support of new bard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants