You can find the code here:
If you follow the steps I outlined in this post http://www.stm32duino.com/viewtopic.php ... 172#p29377 ( sorry for hijacking the end of your thread @joelcrouch ), you can see how I created the files in the variant/NUCLEO_F030R8 directory.
To get this to compile, I had to hack up stm32/analog.c to avoid all the DAC functions. This could probably be nicer. I just wanted to throw this out here so others might try it.
One change I made because this chip has such a small amount of ram, I limited the variant to one Serial port. You can conditionally include the Serial1 if you add a define to the board.txt file (-DENABLE_SERIAL1). This change cuts down on the ram usage by not adding the usart buffer used by the second Serial1 port. You probably won't use that most of the time anyhow. Serial is connected to the Nucleo board's VCP and connected to cortex-m0 on USART2 (PA2/PA3). See UM1724 for the pin mapping.
I decided to make the default Oscillator the High Speed Internal one clocked at 48MHz using the PLL. I played around with the value of the internal Oscillator trim value and measured it with a scope. A value of 15 yields the most accurate 48MHz clock for me. You might have to adjust this if your clock speed isn't right.
https://github.com/RickKimball/Arduino_ ... t.cpp#L152
You can measure you clock speed by adding this line below to your setup() function. Then measure PA8 with a scope to find out your actual SYSCLK frequency.
Code: Select all
HAL_RCC_MCOConfig(RCC_MCO, RCC_MCO1SOURCE_SYSCLK, RCC_MCODIV_1);
https://github.com/RickKimball/Arduino_ ... pt.ld#L167
I discard the ._user_heap_stack section:
This seems to not include that section in the .elf when linking. That prevents the IDE from telling you are using RAM of 1.5k of heap and 512 bytes of stack. However, it does seem to fail when linking if you exceed the min_heap+min_stack size. Not including it in the .elf file gives you a more accurate count of how much RAM memory your application is using. Note: If you are using heap then you will have to mentally add those values to the size shown by the Arduino IDE. The Arduino IDE will also complain if you are using more than 70% of the available RAM./DISCARD/._user_heap_stack :
In all cases, with a small RAM chip like this, you have to keep your eye on how much RAM you are using.
If you give this a try let me know. Overall it isn't that bad a process. Although, the jury is still out if the features work. I need to do a lot more testing.