Coder Social home page Coder Social logo

stevstrong / arduino_stm32 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rogerclarkmelbourne/arduino_stm32

38.0 38.0 9.0 39.58 MB

Arduino STM32. Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 and STM32F407 boards.

License: Other

C 72.27% C++ 22.03% Assembly 1.14% Makefile 0.27% Processing 0.05% Java 1.56% CSS 0.03% Awk 0.01% Shell 0.15% Python 0.48% HTML 1.34% Batchfile 0.04% GDB 0.01% M4 0.04% Roff 0.54% NASL 0.05% BitBake 0.01%

arduino_stm32's People

Contributors

ag88 avatar arminjo avatar arpruss avatar aster94 avatar bobc avatar bubulindo avatar csnol avatar dewhisna avatar edogaldo avatar electricrcaircraftguy avatar fpistm avatar jcw avatar kenwillmott avatar kiki-lamb avatar lacklustrlabs avatar lightningstalker avatar martinayotte avatar mtiutiu avatar pamribeirox avatar rogerclarkmelbourne avatar saloid avatar serasidis avatar stevstrong avatar sukkopera avatar syfre avatar synergie7 avatar testato avatar tfry-git avatar victorlamoine avatar victorpv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino_stm32's Issues

Install Core in PlatformIO

I don't know if it is the right place to ask this, but I have no other idea, since the stm32duino forum is down.

What is the best/easiest way to install your Core in PlatformIO?

I did some researching, but could not find anything.

Thanks!

STM32F4: HardwareTimer.setperiod(uint32_t usecs) is making it running 2 times too fast.

HardwareTimer.setperiod(uint32_t usecs) is making it running 2 times too fast.
https://www.stm32duino.com/viewtopic.php?p=736#p736

fix:
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/HardwareTimer.cpp#L57

uint16 HardwareTimer::setPeriod(uint32 microseconds)
...
  uint32 period_cyc = microseconds * (CYCLES_PER_MICROSECOND / 2);

change to

uint16 HardwareTimer::setPeriod(uint32 microseconds)
...
  uint32 period_cyc = microseconds * (CYCLES_PER_MICROSECOND );

Error compiling i2c_wire_scanner example

Hi,
I encountered an error compiling the i2c_wire_example
below is the error message.

C:\Users\LAPTOP\Desktop\arduino-1.8.9_F407_stev\hardware\Arduino_STM32_stev_jan4\STM32F4\libraries\Wire\Wire.cpp: In constructor 'TwoWire::TwoWire(uint8, uint8)':

C:\Users\LAPTOP\Desktop\arduino-1.8.9_F407_stev\hardware\Arduino_STM32_stev_jan4\STM32F4\libraries\Wire\Wire.cpp:66:20: error: 'I2C2' was not declared in this scope

         sel_hard = I2C2;

                    ^

Maybe its just only not declared.
I hope you can check this out.

Timers 9-14 interrupt handler setup doesn't work

Hi
I work with STM32F407. Trying to set update interrupt handler for the timer 12, I found out that it actually works only for the timers from 1 to 8. For the timers 9-14 the function enable_nonmuxed_irq() (module timer.c), which is called from HardwareTimer::attachInterrupt(), does nothing. Actually these interrupt vectors are shared with another hardware, so when I wrote
Timer8.attachInterrupt(TIMER_BREAK_INTERRUPT, myTimer12Handler);
instead of
Timer12.attachInterrupt(TIMER_UPDATE_INTERRUPT, myTimer12Handler);
I got it work.

updates in adc.h and adc.c

hi, this is a heads up for now

i'm making a usb oscilloscope out of a F401 pill board, after working out the various bugs, issues.It has reached stability. The app seem to run in all cases , even though i tried to 'abuse' my app. so the additions should be rather robust. i've also reviewed the ref manual for F405/F407 and see that they are after all the same definitions, so it should work across the series.F405/F407 actually have more register bits as F401 but F401 is a subset of F405/F407/F411

i'd like to commit my changes back to the F4 core. I'm still in the process of tidying up my codes, preparing to publish my project and hence i've not made any PR or commits to the github repositories yet.

some questions are, would you prefer that i commit it (the PR) on your repository or roger's repository? i'm thinking that committing it with your repository firsthand may be 'better' in a sense that if you have made other changes, the changes can be merged firsthand so that the subsequent PR to roger's core can be merged together.

the changes done are:

  • adc_prescaler
    this is modeled after the same function in the F1 core, the macro symbols are same as well. this would make it more 'compatible' for those writing codes that may possibly be used in both F1 and F4 sets.

adc.h

/**
 * @brief STM32F1/F4 ADC prescalers, as divisors of PCLK2.
 */
typedef enum adc_prescaler {
    /** PCLK2 divided by 2 */
    ADC_PRE_PCLK2_DIV_2 = 0,
    /** PCLK2 divided by 4 */
    ADC_PRE_PCLK2_DIV_4 = 1,
    /** PCLK2 divided by 6 */
    ADC_PRE_PCLK2_DIV_6 = 2,
    /** PCLK2 divided by 8 */
    ADC_PRE_PCLK2_DIV_8 = 3,
} adc_prescaler;

void adc_set_prescaler(adc_prescaler pre);

adc.c

/*
 *  @param pre, setup the ADC prescaler to one of PCLK /2, /4, /6, /8
 *         the templates per adc_prescaler enum
 */
void adc_set_prescaler(adc_prescaler pre) {

	ADC_COMMON->CCR &= ~ ADC_CCR_ADCPRE;
	ADC_COMMON->CCR |= ((pre & 3U) << ADC_CCR_ADCPRE_SHIFT);
}
  • add static inline void adc_awd_disable()

adc.h

static inline void adc_awd_disable(const adc_dev * dev)
{
	dev->regs->CR1 &= ~ADC_CR1_AWDEN;
}
  • add ADC overrun interrupt support,
    add missing adc_awd_enable_irq() when setting up adc_awd irq handler

adc.h

//Added by bubulindo - Interrupt ID's for ADC
typedef enum {
    ADC_EOC,     // End Of Conversion interrupt.
    ADC_AWD ,    // Analog WatchDog interrupt
    ADC_JEOC,    // Injected End Of Conversion interrupt.
    ADC_OVR,	 // overrun interrupt
    ADC_LAST_IRQ_ID
} adc_irq_id;

void adc_ovr_enable_irq(const adc_dev* dev);

adc.c

void adc_ovr_enable_irq(const adc_dev* dev)
{
    dev->regs->CR1 |= ADC_CR1_OVRIE;
    //nvic_irq_enable(NVIC_ADC_1_2_3);
}

void adc_attach_interrupt(const adc_dev *dev,
                            adc_irq_id irq_id,
                            voidFuncPtr handler)
{
    if (irq_id<ADC_LAST_IRQ_ID)
    {
        (*(dev->handler_p))[irq_id] = handler;
        if(irq_id == ADC_EOC)
        	adc_enable_irq(dev);
        else if (irq_id == ADC_AWD)
        	adc_awd_enable_irq(dev);
        else if (irq_id == ADC_OVR)
        	adc_ovr_enable_irq(dev);
    }
}

/*
    ADC IRQ handler. 
    added by bubulindo
*/
void adc_irq_handler(const adc_dev * dev)
{
    //End Of Conversion
    if (dev->regs->SR & ADC_SR_EOC) {
        dev->regs->SR = ~ADC_SR_EOC;
        voidFuncPtr handler = (*(dev->handler_p))[ADC_EOC];
        if (handler) {
            handler();
        }
    }
    //Injected End Of Conversion
    if (dev->regs->SR & ADC_SR_JEOC) {
        dev->regs->SR = ~ADC_SR_JEOC;
        voidFuncPtr handler = (*(dev->handler_p))[ADC_JEOC];
        if (handler) {
            handler();
        }
    }
    //Analog Watchdog
    if (dev->regs->SR & ADC_SR_AWD) {
        dev->regs->SR = ~ADC_SR_AWD;
        voidFuncPtr handler = (*(dev->handler_p))[ADC_AWD];
        if (handler) {
            handler();
        }
    }

    //ADC overrun interrupt
    if (dev->regs->SR & ADC_SR_OVR) {
        dev->regs->SR = ~ADC_SR_OVR;
        voidFuncPtr handler = (*(dev->handler_p))[ADC_OVR];
        if (handler) {
            handler();
        }
    }

}

PR 753 rtc adjustments on original roger's core

hi steve, can you help me commit this PR in roger's core?
PR573
this in part as someone asked about LSE compensation / drift adjustment
https://www.stm32duino.com/viewtopic.php?f=7&t=826
calibratertc(time_t time_now) lets user input the accurate time and computes the drift adjustments
without this pr the function can only be called once.
i think users tend to do a calibration and find that there is still a drift.
A user used that and attempted to call the internal functions to fix the drift and i think an error/fault occured
writing to the backup registers.
rogerclarkmelbourne#731
PR573
resolves the problem as it allows the user to call calibratertc(time_t time_now) repeatedly and the drift adjustments are refined with each additional call, it also avoided the potential error/fault as users won't need to 'fix' the drift by attempting to access the parameter in the backup registers directly

Fail on compile

This is what I'm getting when I try to compile a blink sketch. Any idea why this would not compile?

Arduino: 1.8.8 (Windows 10), Board: "Generic STM32F407V series, USB serial (CDC), STLink, Smallest (default)"

In file included from C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple/libmaple/usbF4/usb.h:8:0,

             from C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple/usb_serial.h:34,

             from C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple/wirish.h:50,

             from C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\system/libmaple/Arduino.h:31,

             from sketch\STM32F407VET6_BLINK.ino.cpp:1:

C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple/libmaple/usbF4/VCP/usb_conf.h:29:22: error: conflicting declaration 'typedef unsigned int uint32_t'

typedef unsigned int uint32_t;

                  ^

In file included from c:\users\icema\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\lib\gcc\arm-none-eabi\4.8.3\include\stdint.h:9:0,

             from C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\cores\maple/wirish.h:38,

             from C:\Users\icema\Documents\Arduino\hardware\Arduino_STM32\STM32F4\system/libmaple/Arduino.h:31,

             from sketch\STM32F407VET6_BLINK.ino.cpp:1:

c:\users\icema\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\stdint.h:66:20: error: 'uint32_t' has a previous declaration as 'typedef __uint32_t uint32_t'

typedef __uint32_t uint32_t ;

                ^

exit status 1
Error compiling for board Generic STM32F407V series.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Red text appears in compiling for Arduino ide 1.8.10

Hi @stevstrong ,
I noticed this red text while compiling in 1.8.10 but there is no red text while compiling for 1.8.9.
Right now I don't know if there will be an impact in the mcu operation when compiled.
The sketch compiled successfully and worked(issue #27 )

Is there would be an impact in the codes?would it generate a bugs?or this is just something to be set in the core?

1.8.10 red text during compilation_line75.txt

C:\Users\LAPTOP\Desktop\arduino-1.8.10\hardware\Arduino_STM32_stev_jan4\STM32F4\cores\maple\WString.cpp: In member function 'void String::remove(unsigned int, unsigned int)':
C:\Users\LAPTOP\Desktop\arduino-1.8.10\hardware\Arduino_STM32_stev_jan4\STM32F4\cores\maple\WString.cpp:700:9: warning: 'char* strncpy(char*, const char*, size_t)' accessing 0 or more bytes at offsets [0, 2147483647] and [0, 2147483647] may overlap up to 4294967295 bytes at offset [6442450941, 2147483647] [-Wrestrict]
  strncpy(writeTo, buffer + index + count,len - index);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attached is the text file of the whole compilation process. See line 75.
Thank you.

changes for flash.h, flash.c - ART accelerator

hi steve,
i'm planning a commit / pr for
STM32F4/cores/maple/libmaple/flash.h
and
STM32F4/cores/maple/libmaple/flash.c

the main changes are the definitions for
FLASH_ACR register

my plan is to introduce the same ART accelerator defines as that used in the official core
https://www.stm32duino.com/viewtopic.php?f=7&p=527#p515

i found out, however, that the flash.h in STM32F4 core
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/libmaple/flash.h#L67
is using the definitions for stm32f103

there are 2 issues:
1 do you prefer that i update flash.h, flash.c directly or that i make a new file called flashF4.h and flashF4.c
2 this is giving me a dilemma, within F4* family there are variations
stm32F405, F407 has 3 bits in the latency field (i.e. up to 7 waits) while F401, F411 etc has 4 bits in the latency field (15 waits)
how do we handle this? do we use definitions like STM32F405 , STM32F407, STM32F401, STM32F411, and do if defs? do we add the underscores e.g. __STM32F405__?
offcial core seem to use macro definitions without the underscores, but it is 'messy' whatever the case
https://github.com/stm32duino/Arduino_Core_STM32/blob/master/cores/arduino/stm32/stm32_def.h#L33
https://github.com/stm32duino/Arduino_Core_STM32/blob/master/system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h#L75
https://github.com/stm32duino/Arduino_Core_STM32/blob/master/system/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h#L144
another way though without the if defs, is to use just 3 bits for latency field. lowest common denominator. my guess is adequate for most cases except if one wants to overclock the processor. still anything more than 7 waits is quite extreme lol

RTClock for f3

i've got an initial working version
RTC changes quite a few files including rcc.h, pw.h, bkp.h, rtc.h, rtc.c etc
it is actually your F4 port adapted to F303C
i got the example working
as i touched several of the core files it is unlikely your own edits would be the same as mine
do you want it in a PR or do you prefer to work it yourself ?

it is on my F3_RTClock branch, you could take a look at the commit
https://github.com/ag-123/Arduino_STM32/tree/F3_RTClock

Problem with DAC F407VGT6 on Blackboard

Hello Steve, I had a problem with the output of the DAC on F407VGT6, on the outputs PA4 and PA5, the output voltage is 1.28 V and does not change. The code of the sketch :

#include "libmaple/dac.h"

void setup() {
dac_init();
dac_enable(DAC_CH1);
dac_enable(DAC_CH2);
}

void loop() {
 dac_write_channel(DAC_CH1,0);
 dac_write_channel(DAC_CH2,0);
 delay(1000);
 dac_write_channel(DAC_CH1,1000);
 dac_write_channel(DAC_CH2,1000);
 delay(1000);
 dac_write_channel(DAC_CH1,2000);
 dac_write_channel(DAC_CH2,2000);
 delay(1000);
 dac_write_channel(DAC_CH1,3000);
 dac_write_channel(DAC_CH2,3000);
 delay(1000);
 dac_write_channel(DAC_CH1,4000);
 dac_write_channel(DAC_CH2,4000);
 delay(1000);
}

F4 possible bug in pheriperials bid-band macro

while tracing some codes in debug, i noted this
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/libmaple/bitband.h#L44

#define __bb_addr(addr, bit, bb_base, bb_ref) \
	(volatile uint32*)((bb_base) + (((uint32)((uint32)(address) - (bb_ref))) * 32) + ((bit) * 4))

i think that addr argument should read as address to be in line with the macro, e.g.

#define __bb_addr(address, bit, bb_base, bb_ref) \
	(volatile uint32*)((bb_base) + (((uint32)((uint32)(address) - (bb_ref))) * 32) + ((bit) * 4))

Bug in the SPI library

Hi @stevstrong ,
I use your Arduino_STM32 and Ethernet_STM32 libraries with the Arduino IDE for the STM32F407VE6 and W5500 hardware. When working with W5500 via the SPI1 port, everything was OK, but I didn't succeed to use SPI2. The following code

SPIClass mSpi(2);
. . .
void setup() {
. . .
Ethernet.init(mSpi, PB12);

doesn't work - the library functions continue to use SPI1 instead.
Analysing your SPIClass code I found out that it's due to the _currentSetting variable which is created as global, outside of any class, instead of being a SPIClass member. So, during the startup procedure, the mSpi instance is initialized prior to the global SPI instance, and the SPI initialization rewrites _currentSetting to point to the SPI1 port. Could you please to fix it?

Sincerely
Alex Orkin

SDIO

Hello.
Do You have some examples to work with SDIO in STM32F1? I have get here by following this stm32duinoforum.com thread. I tried to follow this instruction, but i getting error right after sd.begin():

_initSDHC_278: DMA->ISR: 0x0, DMA->CCR: 0x0, DMA->CNDTR: 0, DMA->CPAR: 0x0, DMA->CMAR: 0x0, DMA->IFCR: 0x0, SDIO->CLKCR: 0x43B2, SDIO->DTIMER: 0x0, SDIO->DCTRL: 0x0, SDIO->DLEN: 0, SDIO->DCOUNT: 0, SDIO->STA: 0x0, SDIO->FIFOCNT: 0
SdFatSdio begin() failed
Can't access SD card. Do not reformat.
SD errorCode: 0X25,0X0

Sorry if it's wrong place for question.

Broken links

Greetings,
FYI
Not sure if you are aware many of the links provided are broken or no longer functional.

http://www.stm32duino.com/

Does not appear to be a credible site. Appears to be a parked domain that refers to adverts or dead links.

Section:
YouTube Videos:

20141116: Arduino 1.5.8 IDE with STM32 board
20150413: STM32 for Arduino 1.6.2 or newer (update)
20150419: Uploading via USB to Serial to STM32F103 boards

None of these exist anymore.

Problem with ADC conversion F407VGT6 Blackboard

Hi Steve,we corresponded on the website stm32duino, I under the nickname STM32_Discoverer. So, I can't run the multichannel_nodma sketch, the led doesn't blink, the data doesn't come to the serial port. I tried to compile for the Discovery Board and for the Board Generic STM32f407V. There is no result. Сan you tell me please, BlackBoard F407VGT6 (DIYMore) refers to the Discovery F407 or generic F407 in the Arduino IDE?

RTClock is broken

When compiling sample, I get the compilation error:

Compiling sketch...
"/Users/vkozlov/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -Wall -MMD -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DERROR_LED_PIN=PA7 -mcpu=cortex-m4 -DF_CPU=168000000L -DARDUINO=10805 -DVARIANT_generic_f407v -DARDUINO_ARCH_STM32F4  -DCRYSTAL_FREQ=8 -DLED_BUILTIN=PA6 -DSERIAL_USB -DUSER_ADDR_ROM=0x08000000  -mthumb -D__STM32F4__ -DSTM32F4 "-I/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/system/libmaple" "-I/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/usbF4" "-I/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/cores/maple" "-I/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/variants/generic_f407v" "-I/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/src" "/var/folders/3v/mdtlw0dj3tx518cdmcm7q3lw0000gn/T/arduino_build_647884/sketch/Test_RTClock.ino.cpp" -o "/var/folders/3v/mdtlw0dj3tx518cdmcm7q3lw0000gn/T/arduino_build_647884/sketch/Test_RTClock.ino.cpp.o"
In file included from /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/examples/Test_RTClock/Test_RTClock.ino:11:0:
/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/src/RTClock.h:98:24: error: conflicting declaration 'volatile uint32 rtc_tr'
 extern volatile uint32 rtc_tr, rtc_dr;
                        ^
In file included from /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/src/RTClock.h:12:0,
                 from /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/examples/Test_RTClock/Test_RTClock.ino:11:
/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/rtc.h:197:26: error: 'rtc_tr' has a previous declaration as 'volatile uint32_t rtc_tr'
 static volatile uint32_t rtc_tr, rtc_dr;
                          ^
In file included from /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/examples/Test_RTClock/Test_RTClock.ino:11:0:
/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/src/RTClock.h:98:32: error: conflicting declaration 'volatile uint32 rtc_dr'
 extern volatile uint32 rtc_tr, rtc_dr;
                                ^
In file included from /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/src/RTClock.h:12:0,
                 from /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock/examples/Test_RTClock/Test_RTClock.ino:11:
/Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/cores/maple/libmaple/rtc.h:197:34: error: 'rtc_dr' has a previous declaration as 'volatile uint32_t rtc_dr'
 static volatile uint32_t rtc_tr, rtc_dr;
                                  ^
Using library RTClock at version 1.0 in folder: /Users/vkozlov/Documents/Arduino/hardware/Arduino_STM32/STM32F4/libraries/RTClock 
exit status 1
Error compiling for board Generic STM32F407V series. 

Using STM32F407VET6 with Arduino

Hi Steve, I am sorry if this isn't the correct place to ask but I asked on the gitter channel and have yet to get a response.

I purchased the STM34F407VET6 board that is recommended on the stm32duino wiki. Since then I have done a large amount of reading on how to get it working with Arduino. I have been unsuccessful on getting it working via USB and Arduino so I tried to get it working with the STlink on a STM32Discovery (MB997B). I have also been unsuccessful. I know it is possible to use these boards but I have been unable to find out how to do so. Would you be able to point me in the direction of how to get this board working however may be currently supported please?

STM32F401, F405, F407, f4xx? backup registers

currently backup registers in the F4 libmaple core don't seem to be reflecting the F4 backup registers
https://github.com/rogerclarkmelbourne/Arduino_STM32/blob/master/STM32F4/cores/maple/libmaple/bkp.h#L101

while attempting to use them, i ran into some bummers. the base address seemed inappropriate. Hence, i've made some changes in my local copy of bkp.h and bkp.c. Apparently on f401, f405, f407, f427 there are 20 backup registers. However, i'm not too sure about the rest.

i've posted a discussion thread in the forum
https://www.stm32duino.com/viewtopic.php?f=63&t=947

I can make a PR if you prefer. However, i've not done that as i'm not sure if the F4xx family has only 20 RTC backup registers as do f401, f405, f407, f427, these are the ones i've just browsed the datasheets and manuals.

my own code tweaks works for myself, but i'm just raising it in case it is useful.

if you prefer that i make a PR, let me know if you prefer for me to make that to roger's repository or yours.
Thanks
edit:
apparently on top of registers the bigger chips e.g. f405, f407, f427, f429 etc has in addition to registers 4KB backup sram.
while f401, f411 only has 20 backup registers. hence, it'd seem 20 backup registers is 'standard', but well i've not really review the rest of specs. and in addition, those on stm32f103 are 16 bit backup registers, while those on stm32f4xx are 32bits registers. This is much more convenient as it can store a full int32 in each register.

F4 timers not clocked at init

hi while messing with the timers on F4. i found it strange that the timers registers did not retain their values. on tracing the codes in debug.
i found that timers are not initialized.
it turns out there is a return statement right at the beginning of the timers initialization.
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/boards.cpp#L125
any reasons for this codes, effectively by passing initialization?

in addition, i'd think we can leave the timers in the disabled state after they are initialized.
and let user codes start the timers if they need them. e.g. commenting or removing the timer.resume()
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/boards.cpp#L155

Unable to compile blink project when board Maple(RET6) is selected from Arduino studio

Hi,

I hope this is the right place to log this issue, if not please close this issue and tell me where to log it

Environment:
OS: Mac OS X
Arduino Studio 1.18.12
STM32duino: 2020.6.20
Board: Leaflabs Maple RET6
Additional Board Manager URLs: http://dan.drown.org/stm32duino/package_STM32duino_index.json

Please check attached image for details. The same code compiles fine when Maple Rev3 is selected.
My remedy is to add the following to the beginning of Arduino15/packages/stm32duino/hardware/STM32F1/2020.6.20/cores/maple/sdio.cpp. Sample blink project, rtos blink project compiled and runs fine with this change.

Note, if I uncomment the #ifdef __cplusplus block, the code wont compile, same error.

//#ifdef __cplusplus
// #include
// using namespace std;
//#else // C
#include <stdlib.h>
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#endif // min

#ifndef max
	#define max(a,b) ((a)>(b)?(a):(b))
#endif // max

//#endif // __cplusplus

Screen Shot 2020-07-19 at 3 35 53 PM

Board manager dialog:
Screen Shot 2020-07-19 at 4 03 09 PM

fpu for f4

fpu is a nice feature of the stm32 cortex-m4, though it'd consume a little more memory
very useful if you do some dsp work like FIR filters etc.

imho good to simply enable it as well as building with fpu is simply adding the compiler flags
-mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
or
-mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
more often we may have users or even ourselves using those flags and we 'forget' to enable the fpu which requires a section of asm codes. then our sketch simply stall and we start wondering why when it is simply that missing enablefpu()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.