I was just wondering about the speed of the stm32l476rg nucleo board!
For say,the arduino uno operates on 16Mhz.What is the clock speed of the stm32l476 in the Arduino environment?
user manual is UM1724. Crystal i noticed is 8MHz if it’s fitted

obtain CubeMX, also the F7 libraries(there’s an update menu for doing this in CubeMX), probably need to acquire ARM tools compiler gcc 6.x.x
have a play in the configuration window, change the hse clock value and see what happens.
you will need to register in order to download the CubeMX package and click to accept license.
scanning the datasheet suggests 80MHz, highest frency in the current consumption table, i think lowest was 100KHz, maybe even 32kHz
stephen
Also is there a way to know what the current speed the cpu is operating on?
If it is this one: https://github.com/stm32duino/Arduino_Core_STM32
You could redefine the void SystemClock_Config(void) in the sketch.
extern "C" void SystemClock_Config(void) {...}
I tried like this below in the arduino:
void setup() {
// put your setup code here, to run once:
#define F_CPU 80000000
SystemCoreClockUpdate();
pinMode(13,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13,HIGH);
digitalWrite(13,LOW);
}
void setup() {
// put your setup code here, to run once:
extern uint32_t SystemCoreClock;
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(SystemCoreClock);
delay(1000);
}
[SHARANYA – Sun Nov 26, 2017 10:52 am] –
Also i was toggling pin-D13 by writting digitalWrite high/low and hooked up a scope to that pin.But I could only get a frequency of about 400khz(Instead the cpu is running at 80MHz).Why it is so slow?Is there a way to make it fast by directly accessing the GPIO registers?
Search the forum for fast GPIO access.
For example: viewtopic.php?f=18&t=2888
void setup() {
// put your setup code here, to run once:
pinMode(13,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
GPIOA->BSRR = (1<<5);
GPIOA->BRR = (1<<5);
}
viewtopic.php?f=18&t=2888&p=37578#p37593
you may see a for-loop takes 417ns with toggling 1/0 (BRR/BSRR registers) at 72MHz, that is 2.39MHz toggling freq..
In order to maximize your io pin frequency you must “unroll the loop”.
void loop() {
// put your main code here, to run repeatedly:
GPIOA->BSRR = (1<<5);
GPIOA->BRR = (1<<5);
GPIOA->BSRR = (1<<5);
GPIOA->BRR = (1<<5);
GPIOA->BSRR = (1<<5);
GPIOA->BRR = (1<<5);
GPIOA->BSRR = (1<<5);
GPIOA->BRR = (1<<5);
....}
Why the signals are Sinusoidal type in nature?I scoped a signal coming out of a AVR at 2MHz that was perfectly square.Is this happening due to the scope’s bandwidth?My scope is Rigol DS1102E which has a 100MHz bandwidth!
The max frequency you may see on your oscope is F_CPU/6 (you need 6clocks to toggle once)
But how the speed is 48Mhz here?
With a 100MHz BW you cannot expect to see a 48MHz digital signal with great edges.. You would need >300MHz BW to be happy..
I edited my post on FCPU/6..
STM32F103 chips (Cortex M3, 72MHz one) like BluePill have got 2 wait states while reading from flash memory. It means they do not usually perform 1 instruction per clock.
STM32F4xx chips (Cortex M4) like L476 have got “ART accelerator” – a special 256bit flash cache – which allows to provide “1 instruction per clock” most times.
Adaptive real-time accelerator (ART Accelerator™) allowing 0-wait-state execution from Flash memory
Thus the counting of cycles in F103 and F4xx may differ. That was my point I added to my previous post you have not read.
[SHARANYA – Sun Nov 26, 2017 5:18 pm] –
One more problem i am facing in the arduino IDE.Each time I close arduino IDE and reopen it,the settings regarding nucleo board/processor etc are getting vanished.The default board is getting selected as Arduino yun.Also i am unable to find the nucleo64 boards in the list.Then i have to reopen the boards manager and after the boards manager is getting refreshed,the nucleo boards are reappearing in the main boards list!Why is this happening.Pardon me for my silly questions as i am not familiar with Arduino IDE.
All my setting/downloaded files for the stm32 core is saved in the C:\Users\SHARANYA\AppData\Local\Arduino15\packages\STM32 folder by default.
Seems strange. Have you tried to clear the local json file? (C:\Users\SHARANYA\AppData\Local\Arduino15\package_stm_index.json*)
Which Arduino IDE version you used and on which OS?