Page 1 of 2
Generic_F030RCT missing?
Posted: Tue Mar 26, 2024 5:14 pm
by Mangy_Dog
So got a project using this chip. While the Arduino core stm32 lists this chip in its variants, its missing from the boards list when creating a new project or setting a project, at least in sloeber.
I installed the core as per the guide here
https://github.com/stm32duino/Arduino_C ... w-to-debug
Do I need to create a custom board entry in the core and point it to this variant? If so... how?
Re: Generic_F030RCT missing?
Posted: Tue Mar 26, 2024 6:39 pm
by fpiSTM
You can find here how to declate the generic:
https://github.com/stm32duino/Arduino_C ... 28board%29
Feel free to submit a PR

Re: Generic_F030RCT missing?
Posted: Wed Mar 27, 2024 9:13 am
by Mangy_Dog
A PR?
Also thanks will go through the guide now.
Re: Generic_F030RCT missing?
Posted: Wed Mar 27, 2024 9:36 am
by fpiSTM
A Pull Request on GitHub.
Re: Generic_F030RCT missing?
Posted: Fri Mar 29, 2024 11:22 am
by Mangy_Dog
Ahh might do... but later.
The current custom isnt the best config at the moment... getting around a bad crystal selection. So its slightly underclocked.
After the fix ill try to remember to pull then push the config up.
Re: Generic_F030RCT missing?
Posted: Wed Apr 03, 2024 1:33 pm
by Mangy_Dog
2 Problems.
It doesn't appear that optimisations are being applied. I have a near empty program with just the sleep library attached. And 3 lines of code. And im getting a 112kb binary... -Os is selected.
Also going by power readings of my board. It appears the clock settings grabbed from CubeIDE are not being applied. And its running at 8Mhz.
Now as I mentioned there has been a mistake on this prototype, where a 25mhz clock is attached. But through the configurator I got this to 45Mhz.
So I should expect to see similar power readings from the datasheet.
Though Im only seeing around 7mA at wake state. Which suggests the STM32 is underclocked to 8mhz...
If a bad clock config is applied does it default to 8 or does it just not run?
Re: Generic_F030RCT missing?
Posted: Wed Apr 03, 2024 1:49 pm
by Mangy_Dog
Binary size difference appears to be Newlib Standard vs Newlib nano setting... Not entirely sure what newlib is...
Clock situation still appears to be happening.
Re: Generic_F030RCT missing?
Posted: Wed Apr 03, 2024 3:38 pm
by fpiSTM
Hard to help without the code you add.
Re: Generic_F030RCT missing?
Posted: Thu Apr 04, 2024 8:46 am
by Mangy_Dog
Its really just a really basic board testing program.
Code: Select all
#include "Arduino.h"
#include "STM32LowPower.h"
//The setup function is called once at startup of the sketch
#define BATT_MON_AIN PA_4
#define BKUP_MON_AIN PA_5
#define ATTN_P PA_11
#define _12V_CH1_IMON PB_0
#define _12V_CH2_IMON PB_1
#define _12V_CH1_PG PB_8
#define _12V_CH2_PG PB_9
#define CHRG_STAT1 PB_10
#define CHRG_STAT2 PB_11
#define CHRG_PG PB_12
#define BKUP_CE PB_13
#define D_IN1 PC_6
#define D_IN2 PC_7
#define BATT_MON_ON PA_6
#define BKUP_MON_ON PA_7
#define _NRST PC_0
#define _12V_CH1_EN PC_4
#define _12V_CH2_EN PC_5
#define PWR_ON_CTRL PC_8
#define PWR_OFF_CTRL PC_9
#define LED1_GRN PC_10
#define LED2_RED PC_11
HardwareSerial Serial2(PA_2, PA_3);
void setup() {
pinMode(BATT_MON_AIN, INPUT); //BATT_MON_AIN
pinMode(BKUP_MON_AIN, INPUT); //BKUP_MON_AIN
pinMode(ATTN_P, INPUT);
pinMode(_12V_CH1_IMON, INPUT); //12V_CH1_IMON
pinMode(_12V_CH2_IMON, INPUT); //12V_CH2_IMON
pinMode(_12V_CH1_PG, INPUT); //12V_CH1_PG
pinMode(_12V_CH2_PG, INPUT); //12V_CH2_PG
pinMode(CHRG_STAT1, INPUT); //CHRG_STAT1
pinMode(CHRG_STAT2, INPUT); //CHRG_STAT2
pinMode(CHRG_PG, INPUT); //CHRG_~{PG}
pinMode(D_IN1, INPUT); //D_IN1
pinMode(D_IN2, INPUT); //D_IN2
pinMode(BATT_MON_ON, OUTPUT); //BATT_MON_ON
pinMode(BKUP_MON_ON, OUTPUT); //BKUP_MON_ON
pinMode(_NRST, OUTPUT); //~{NOTECARD_NRST}
pinMode(_12V_CH1_EN, OUTPUT); //12V_CH1_EN
pinMode(_12V_CH2_EN, OUTPUT); //12V_CH2_EN
pinMode(PWR_ON_CTRL, OUTPUT); //AJAX_PWR_ON_CTRL
pinMode(PWR_OFF_CTRL, OUTPUT); //AJAX_PWR_OFF_CTRL
pinMode(LED1_GRN, OUTPUT); //LED1_GRN
pinMode(LED2_RED, OUTPUT); //LED2_RED
pinMode(BKUP_CE, OUTPUT); //BKUP_CE
digitalWrite(BKUP_CE, HIGH);
digitalWrite(BATT_MON_ON, LOW);
digitalWrite(BKUP_MON_ON, LOW);
//clean reset
digitalWrite(_NRST, LOW);
delay(100);
digitalWrite(_NRST, HIGH);
digitalWrite(_12V_CH1_EN, LOW);
digitalWrite(_12V_CH2_EN, LOW);
digitalWrite(PWR_ON_CTRL, LOW);
digitalWrite(PWR_OFF_CTRL, LOW);
digitalWrite(LED1_GRN, LOW);
digitalWrite(LED2_RED, LOW);
//led indication
digitalWrite(LED1_GRN, HIGH);
delay(200);
digitalWrite(LED2_RED, HIGH);
delay(200);
digitalWrite(LED1_GRN, LOW);
delay(200);
digitalWrite(LED2_RED, LOW);
delay(200);
//trigger relay on off
digitalWrite(PWR_ON_CTRL, HIGH);
delay(10); // datasheet says 1 to 2 ms this delay could be reduced.
digitalWrite(PWR_ON_CTRL, LOW);
delay(500);
digitalWrite(PWR_OFF_CTRL, HIGH);
delay(10);
digitalWrite(PWR_OFF_CTRL, LOW);
Serial2.begin(9600);
LowPower.begin();
// Add your initialization code here
}
// The loop function is called in an endless loop
void loop() {
//for (int i = 0; i < 2; i++) {
digitalWrite(LED2_RED, HIGH);
delay(200);
digitalWrite(LED2_RED, LOW);
delay(200);
//Serial2.println("asuiodhasidhoijashohsdf");
digitalWrite(PWR_ON_CTRL, HIGH);
delay(10); // datasheet says 1 to 2 ms this delay could be reduced.
digitalWrite(PWR_ON_CTRL, LOW);
delay(1000);
digitalWrite(PWR_OFF_CTRL, HIGH);
delay(10);
digitalWrite(PWR_OFF_CTRL, LOW);
digitalWrite(_12V_CH1_EN, HIGH);
delay(200);
digitalWrite(_12V_CH1_EN, LOW);
delay(200);
digitalWrite(_12V_CH2_EN, HIGH);
delay(200);
digitalWrite(_12V_CH2_EN, LOW);
delay(200);
//}
//LowPower.deepSleep(10000);
}
33,064 bytes

- Capture1.PNG (16.21 KiB) Viewed 7575 times
119,932 bytes

- Capture2.PNG (16.04 KiB) Viewed 7575 times
To be honest even 33kb seems like a large binary for that program...
Re: Generic_F030RCT missing?
Posted: Thu Apr 04, 2024 9:10 am
by fpiSTM
You can optimize several things as explained in the wiki.
About code, I talk about the variant and the update you made else can't help on the clock issue. Some hardware info can help also. Like HSE? LSE?....