Generic_F030RCT missing?

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
User avatar
Mangy_Dog
Posts: 97
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Generic_F030RCT missing?

Post 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?
Just a dogs body developer, mostly making props and stuff...
User avatar
fpiSTM
Posts: 1754
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Generic_F030RCT missing?

Post 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 ;)
User avatar
Mangy_Dog
Posts: 97
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Generic_F030RCT missing?

Post by Mangy_Dog »

A PR?

Also thanks will go through the guide now.
Just a dogs body developer, mostly making props and stuff...
User avatar
fpiSTM
Posts: 1754
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Generic_F030RCT missing?

Post by fpiSTM »

A Pull Request on GitHub.
User avatar
Mangy_Dog
Posts: 97
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Generic_F030RCT missing?

Post 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.
Just a dogs body developer, mostly making props and stuff...
User avatar
Mangy_Dog
Posts: 97
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Generic_F030RCT missing?

Post by Mangy_Dog »

fpiSTM wrote: Tue Mar 26, 2024 6:39 pm You can find here how to declate the generic:
https://github.com/stm32duino/Arduino_C ... 28board%29

Feel free to submit a PR ;)
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?
Just a dogs body developer, mostly making props and stuff...
User avatar
Mangy_Dog
Posts: 97
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Generic_F030RCT missing?

Post by Mangy_Dog »

Binary size difference appears to be Newlib Standard vs Newlib nano setting... Not entirely sure what newlib is... :D
Clock situation still appears to be happening.
Just a dogs body developer, mostly making props and stuff...
User avatar
fpiSTM
Posts: 1754
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Generic_F030RCT missing?

Post by fpiSTM »

Hard to help without the code you add.
User avatar
Mangy_Dog
Posts: 97
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Generic_F030RCT missing?

Post 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
Capture1.PNG (16.21 KiB) Viewed 637 times
119,932 bytes
Capture2.PNG
Capture2.PNG (16.04 KiB) Viewed 637 times
To be honest even 33kb seems like a large binary for that program...
Just a dogs body developer, mostly making props and stuff...
User avatar
fpiSTM
Posts: 1754
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Generic_F030RCT missing?

Post 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?....
Post Reply

Return to “IDE's”