Skip to content

support for F030 series #366

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

Closed
wants to merge 2 commits into from
Closed

support for F030 series #366

wants to merge 2 commits into from

Conversation

Adminius
Copy link
Contributor

@Adminius Adminius commented Nov 1, 2018

Demo Board #165
Blink OK (uses 9820 Bytes / 59% of flash)
PWM (fading) OK (uses 11668 Bytes / 71% of flash)

Analog pins doesn't work (NUM_ANALOG_FIRST must be 0, NUM_ANALOG_INPUTS = 9) but:

pins_arduino.h:55:1: error: static assertion failed: First analog pin value (A0) must be greater than or equal to NUM_ANALOG_INPUTS
_Static_assert(NUM_ANALOG_FIRST >= NUM_ANALOG_INPUTS,

@fpistm fpistm added the new variant Add support of new bard label Nov 2, 2018
@fpistm
Copy link
Member

fpistm commented Nov 2, 2018

This is to allow to use analogRead(0) == analogRead(A0) and analogWrite(0) == analogWrite(D0)

Analog pins doesn't work (NUM_ANALOG_FIRST must be 0, NUM_ANALOG_INPUTS = 9) but:

pins_arduino.h:55:1: error: static assertion failed: First analog pin value (A0) must be greater than or equal to NUM_ANALOG_INPUTS
_Static_assert(NUM_ANALOG_FIRST >= NUM_ANALOG_INPUTS,

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.

I've made a branch with all fixed mentioned in this review.
I've made also some clean (trailing space, file format,...)

My branch:
fpistm@1149d33

#define HAL_SPI_MODULE_ENABLED
#define HAL_TIM_MODULE_ENABLED
//#define HAL_TSC_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#define HAL_UART_MODULE_ENABLED
/*#define HAL_UART_MODULE_ENABLED*/

This have to be comment

#define HAL_TIM_MODULE_ENABLED
//#define HAL_TSC_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
#define HAL_USART_MODULE_ENABLED
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#define HAL_USART_MODULE_ENABLED
/*#define HAL_USART_MODULE_ENABLED*/

This have to be comment

#define PA14 12 //D12 - SWCLK

// This must be a literal with the same value as PEND
#define NUM_DIGITAL_PINS 13
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#define NUM_DIGITAL_PINS 13
#define NUM_DIGITAL_PINS 22

Here 22 as you have to count the duplicated pins

#define NUM_DIGITAL_PINS 13
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 9
#define NUM_ANALOG_FIRST 9
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#define NUM_ANALOG_FIRST 9
#define NUM_ANALOG_FIRST 13

Here this is 13 then you will not have the static assert and analog will be functional

@@ -0,0 +1,322 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

Please align this file with the last template:
system/Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_conf_template.h

*/
#define HAL_MODULE_ENABLED
#define HAL_ADC_MODULE_ENABLED
//#define HAL_CAN_MODULE_ENABLED
Copy link
Member

Choose a reason for hiding this comment

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

Here use /*...*/ instead of //...

@@ -467,6 +467,35 @@ Disco.menu.upload_method.STLink.upload.tool=stlink_upload
# Other boards

###############################
# Generic F030
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Generic F030
# Generic F0

I guess it should be better to provide F0 menu for future addition like the GenF4

Moreover it miss the C Runtime menu and Serial (to add later in this file):

+GenF0.menu.xserial.generic=Enabled with generic Serial
+GenF0.menu.xserial.none=Enabled without generic Serial
+GenF0.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
+GenF0.menu.xserial.disabled=Disabled (No Serial)
+GenF0.menu.xserial.disabled.build.xSerial=
+GenF0.menu.rtlib.nano=Newlib Nano (default)
+GenF0.menu.rtlib.nanofp=Newlib Nano + Float Printf
+GenF0.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float
+GenF0.menu.rtlib.nanofs=Newlib Nano + Float Scanf
+GenF0.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float
+GenF0.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
+GenF0.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
+GenF0.menu.rtlib.full=Newlib Standard
+GenF0.menu.rtlib.full.build.flags.ldspecs=

@@ -467,6 +467,35 @@ Disco.menu.upload_method.STLink.upload.tool=stlink_upload
# Other boards

###############################
# Generic F030
GenF030.name=Generic STM32F030 series
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
GenF030.name=Generic STM32F030 series
GenF0.name=Generic STM32F0 series

So replace all GenF030 by GenF0

@fpistm
Copy link
Member

fpistm commented Nov 2, 2018

With my branch including review (#367):

Blink:

  • with Serial and Os:

Sketch uses 9668 bytes (59%) of program storage space. Maximum is 16384 bytes.
Global variables use 964 bytes (23%) of dynamic memory, leaving 3132 bytes for local variables. Maximum is 4096 bytes.

  • without Serial and Os

Sketch uses 8020 bytes (48%) of program storage space. Maximum is 16384 bytes.
Global variables use 496 bytes (12%) of dynamic memory, leaving 3600 bytes for local variables. Maximum is 4096 bytes.

  • without Serial and Os + LTO

Sketch uses 5384 bytes (32%) of program storage space. Maximum is 16384 bytes.
Global variables use 568 bytes (13%) of dynamic memory, leaving 3528 bytes for local variables. Maximum is 4096 bytes.

Fading:

  • with Serial and Os:

Sketch uses 11512 bytes (70%) of program storage space. Maximum is 16384 bytes.
Global variables use 976 bytes (23%) of dynamic memory, leaving 3120 bytes for local variables. Maximum is 4096 bytes.

  • without Serial and Os

Sketch uses 9864 bytes (60%) of program storage space. Maximum is 16384 bytes.
Global variables use 508 bytes (12%) of dynamic memory, leaving 3588 bytes for local variables. Maximum is 4096 bytes.

  • without Serial and Os + LTO

Sketch uses 8700 bytes (53%) of program storage space. Maximum is 16384 bytes.
Global variables use 768 bytes (18%) of dynamic memory, leaving 3328 bytes for local variables. Maximum is 4096 bytes.

@fpistm fpistm mentioned this pull request Nov 2, 2018
@fpistm
Copy link
Member

fpistm commented Nov 2, 2018

Merge thanks #367

@fpistm fpistm closed this Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new variant Add support of new bard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants