Modification of mbed-src library only for STM32F030F4, very cheap microcontroller in 20-Pin TSSOP package, with 16Kbytes of Flash and 4Kbytes of Ram. **Target for online compilator must be Nucleo 32F030R8.**

Dependents:   STM32F031_blink_LED_2


Information

For programming similar chips in TSSOP20 package, but with 32kB flash: STM32F031F6 and STM32F050F6 (virtually identical to STM32F031F6 and no longer produced but still on sale), it is recommended to use NUCLEO-F031K6 as compiler platform, and the mbed library without the need for any modifications.

Just remember that the only significant difference between these chips and NUCLEO-F031K6 is the lack of pins: PB_0, PB_3, PB_4, PB_5, PB_6, PB_7, PA_11, PA_12, PA_15 in TSSOP-20.



STM32F030F4 pinout (pin functions supported in mbed library).

/media/uploads/mega64/mbedf4.jpg

other pins:

Pin nrPin nameConnectedST-LINK on Nucleo (programming and debug)
1.BOOT0GND
4.NRSTCN4 pin 5
5.VDDA+3.3V
15.VSSGNDCN4 pin 3
16.VDD+3.3V
19.SWDIOCN4 pin 4
20.SWCLKCN4 pin 2
  • Remove jumpers CN2 on Nucleo when CN4 is connected to STM32F030F4
  • NRST connection is not necessarily needed, but in this case, after programming it is necessary to manually reset the target processor


STM32R030F4 programming using Nucleo (any type):
/media/uploads/mega64/f4_nucleo.jpg Notes:

  • When programming using the Nucleo virtual disk (drag and drop) , first turn on the power STM32F030F4, and then connect Nucleo to USB. When programming with "ST-LINK Utility", it does not matter.




STM32R030F4 programming using Arduino (as a simple USB-Serial converter) and FlyMcu program:
/media/uploads/mega64/f4_arduino.jpg

Notes:

  • For Usart in STM32F030F4, only 5V tolerant TX, RX pins are pins 17 and 18. Just their uses internal serial bootloader, so you can use such Arduino or other USB-Serial converter operating as standard 5V.
  • Where used FlyMcu, binary file from online compiler Mbed need to convert to intel hex file and during the conversion add the data offset 0x08000000 (or if offset is 0, manually add/edit the first line of the .hex file to ":020000040800F2").
  • During programming procedure, pin 1 (BOOT0) should be connected to 3.3 V. And before contact with the loader program, temporarily pin 4 (NRST) shorted to GND to reset the chip. After programming BOOT0 is connected to GND.
  • In this set with Arduino Uno, the "Flash loader demonstrator" from STM does not work (does not recognize the response from the chip at the initial stage of connection). But with Arduino Duemilanove program "STM Flash loader demonstrator" works perfectly (ver. 2.7.0). And do not need any additional file conversion (as the need for FlyMcu). You can use a binary file directly from the on-line compiler mbed.

Warning.
Because of the small size of the STM32F030F4 flash, for programs that use UART, it is proposed not to use the Serial class but use the <cstdio> (stdio.h) functions that directly use stdout and stdin (e.g printf().putchar(),getchar(),vprintf(),scanf() ).

Example:

version with serial class

#include "mbed.h"
Serial pc(USBTX, USBRX); // tx, rx

int main()
{

    pc.printf("Hello World!\n");

}

consuming 13.7kB FLASH and 1.5kB RAM

but this:

version without serial class

#include "mbed.h"
int main()
{

    printf("Hello World!\n");

}

consuming only 8.7kB FLASH and 0.4kB RAM

5kB used flash difference (with 16kB total size) !!!

However, if you need other than the default UART settings for stdin and stdout (that is 9600b, pins PA_2, PA_3), you can do as an example:

change uart pins and speed

#include "mbed.h"

// declarations needed to change here the parameters of stdio UART
extern int stdio_uart_inited;
extern serial_t stdio_uart; 

int main()
{
    // for change pins
    serial_init(&stdio_uart, PA_9,PA_10);
    stdio_uart_inited=1;

    // for change baud rate
    serial_baud(&stdio_uart, 115000);


    printf("Hello World!\n");

}




uVision users

In the case of online compilation of the program with this library using Keil, to prevent linker errors set in the project options "One ELF Section per Function" and Optimisation: Level 2.



Additional information (and inspiration for this modification):

http://developer.mbed.org/forum/electronics/topic/5184/

http://developer.mbed.org/questions/4643/Does-mbed-support-STM32F030F4/

http://developer.mbed.org/questions/2927/mbed-on-other-packages-stm32f030f4-TSSOP/

http://developer.mbed.org/questions/4139/Programming-STM32F030F4-with-Nucleo-F030/

Files at this revision

API Documentation at this revision

Comitter:
mega64
Date:
Mon Nov 10 05:43:20 2014 +0000
Parent:
2:d4e65471856e
Child:
4:9de90bc0f5b5
Commit message:
change uart,pwm,i2c,spi

Changed in this revision

targets/cmsis/TARGET_STM/TARGET_NUCLEO_F030R8/stm32f0xx_hal_gpio_ex.h Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/i2c_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/pwmout_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/serial_api.c Show annotated file Show diff for this revision Revisions of this file
targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/spi_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F030R8/stm32f0xx_hal_gpio_ex.h	Mon Nov 10 01:43:37 2014 +0000
+++ b/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F030R8/stm32f0xx_hal_gpio_ex.h	Mon Nov 10 05:43:20 2014 +0000
@@ -64,7 +64,9 @@
   * @{
   */
   
-#if defined (STM32F030x6)
+// #if defined (STM32F030x6)
+// STM32F030F4
+#if 1
 /*------------------------- STM32F030x6---------------------------*/ 
 /* AF 0 */
 #define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
@@ -109,7 +111,8 @@
 #endif /* STM32F030x6 */
 
 /*---------------------------------- STM32F030x8 -------------------------------------------*/
-#if defined (STM32F030x8)
+// #if defined (STM32F030x8)
+#if 0
 /* AF 0 */
 #define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
 #define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
@@ -158,417 +161,7 @@
 
 #endif /* STM32F030x8 */
 
-#if defined (STM32F031x6) || defined (STM32F038xx)
-/*--------------------------- STM32F031x6/STM32F038xx ---------------------------*/
-/* AF 0 */
-#define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
-#define GPIO_AF0_SPI1         ((uint8_t)0x00)  /*!< AF0: SPI1/I2S1 Alternate Function mapping */
-#define GPIO_AF0_TIM17        ((uint8_t)0x00)  /*!< AF0: TIM17 Alternate Function mapping     */
-#define GPIO_AF0_SWDAT        ((uint8_t)0x00)  /*!< AF0: SWDAT Alternate Function mapping     */
-#define GPIO_AF0_SWCLK        ((uint8_t)0x00)  /*!< AF0: SWCLK Alternate Function mapping     */
-#define GPIO_AF0_TIM14        ((uint8_t)0x00)  /*!< AF0: TIM14 Alternate Function mapping     */
-#define GPIO_AF0_USART1       ((uint8_t)0x00)  /*!< AF0: USART1 Alternate Function mapping    */
-#define GPIO_AF0_IR           ((uint8_t)0x00)  /*!< AF0: IR Alternate Function mapping        */
 
-/* AF 1 */
-#define GPIO_AF1_TIM3         ((uint8_t)0x01)  /*!< AF1: TIM3 Alternate Function mapping      */
-#define GPIO_AF1_USART1       ((uint8_t)0x01)  /*!< AF1: USART1 Alternate Function mapping    */
-#define GPIO_AF1_IR           ((uint8_t)0x01)  /*!< AF1: IR Alternate Function mapping        */
-#define GPIO_AF1_EVENTOUT     ((uint8_t)0x01)  /*!< AF1: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF1_I2C1         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-
-/* AF 2 */
-#define GPIO_AF2_TIM1         ((uint8_t)0x02)  /*!< AF2: TIM1 Alternate Function mapping      */
-#define GPIO_AF2_TIM2         ((uint8_t)0x02)  /*!< AF2: TIM2 Alternate Function mapping      */
-#define GPIO_AF2_TIM16        ((uint8_t)0x02)  /*!< AF2: TIM16 Alternate Function mapping     */
-#define GPIO_AF2_TIM17        ((uint8_t)0x02)  /*!< AF2: TIM17 Alternate Function mapping     */
-#define GPIO_AF2_EVENTOUT     ((uint8_t)0x02)  /*!< AF2: EVENTOUT Alternate Function mapping  */
-
-/* AF 3 */
-#define GPIO_AF3_EVENTOUT     ((uint8_t)0x03)  /*!< AF3: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF3_I2C1         ((uint8_t)0x03)  /*!< AF3: I2C1 Alternate Function mapping      */
-
-/* AF 4 */
-#define GPIO_AF4_TIM14        ((uint8_t)0x04)  /*!< AF4: TIM14 Alternate Function mapping     */
-#define GPIO_AF4_I2C1         ((uint8_t)0x04)  /*!< AF4: I2C1 Alternate Function mapping      */
-
-/* AF 5 */
-#define GPIO_AF5_TIM16        ((uint8_t)0x05)  /*!< AF5: TIM16 Alternate Function mapping     */
-#define GPIO_AF5_TIM17        ((uint8_t)0x05)  /*!< AF5: TIM17 Alternate Function mapping     */
-
-/* AF 6 */
-#define GPIO_AF6_EVENTOUT     ((uint8_t)0x06)  /*!< AF6: EVENTOUT Alternate Function mapping  */
-
-#define IS_GPIO_AF(AF)        ((AF) <= (uint8_t)0x06)
-
-#endif /* STM32F031x6 || STM32F038xx */
-
-#if defined (STM32F051x8) || defined (STM32F058xx)
-/*--------------------------- STM32F051x8/STM32F058xx---------------------------*/
-/* AF 0 */
-#define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
-#define GPIO_AF0_SPI1         ((uint8_t)0x00)  /*!< AF0: SPI1/I2S1 Alternate Function mapping */
-#define GPIO_AF0_SPI2         ((uint8_t)0x00)  /*!< AF0: SPI2 Alternate Function mapping      */
-#define GPIO_AF0_TIM15        ((uint8_t)0x00)  /*!< AF0: TIM15 Alternate Function mapping     */
-#define GPIO_AF0_TIM17        ((uint8_t)0x00)  /*!< AF0: TIM17 Alternate Function mapping     */
-#define GPIO_AF0_SWDIO        ((uint8_t)0x00)  /*!< AF0: SWDIO Alternate Function mapping     */
-#define GPIO_AF0_SWCLK        ((uint8_t)0x00)  /*!< AF0: SWCLK Alternate Function mapping     */
-#define GPIO_AF0_TIM14        ((uint8_t)0x00)  /*!< AF0: TIM14 Alternate Function mapping     */
-#define GPIO_AF0_USART1       ((uint8_t)0x00)  /*!< AF0: USART1 Alternate Function mapping    */
-#define GPIO_AF0_IR           ((uint8_t)0x00)  /*!< AF0: IR Alternate Function mapping        */
-#define GPIO_AF0_CEC          ((uint8_t)0x00)  /*!< AF0: CEC Alternate Function mapping       */
-
-/* AF 1 */
-#define GPIO_AF1_TIM3         ((uint8_t)0x01)  /*!< AF1: TIM3 Alternate Function mapping      */
-#define GPIO_AF1_TIM15        ((uint8_t)0x01)  /*!< AF1: TIM15 Alternate Function mapping     */
-#define GPIO_AF1_USART1       ((uint8_t)0x01)  /*!< AF1: USART1 Alternate Function mapping    */
-#define GPIO_AF1_USART2       ((uint8_t)0x01)  /*!< AF1: USART2 Alternate Function mapping    */
-#define GPIO_AF1_EVENTOUT     ((uint8_t)0x01)  /*!< AF1: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF1_I2C1         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_I2C2         ((uint8_t)0x01)  /*!< AF1: I2C2 Alternate Function mapping      */
-#define GPIO_AF1_IR           ((uint8_t)0x01)  /*!< AF1: IR Alternate Function mapping        */
-#define GPIO_AF1_CEC          ((uint8_t)0x01)  /*!< AF1: CEC Alternate Function mapping       */
-
-/* AF 2 */
-#define GPIO_AF2_TIM1         ((uint8_t)0x02)  /*!< AF2: TIM1 Alternate Function mapping      */
-#define GPIO_AF2_TIM2         ((uint8_t)0x02)  /*!< AF2: TIM2 Alternate Function mapping      */
-#define GPIO_AF2_TIM16        ((uint8_t)0x02)  /*!< AF2: TIM16 Alternate Function mapping     */
-#define GPIO_AF2_TIM17        ((uint8_t)0x02)  /*!< AF2: TIM17 Alternate Function mapping     */
-#define GPIO_AF2_EVENTOUT     ((uint8_t)0x02)  /*!< AF2: EVENTOUT Alternate Function mapping  */
-
-/* AF 3 */
-#define GPIO_AF3_EVENTOUT     ((uint8_t)0x03)  /*!< AF3: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF3_I2C1         ((uint8_t)0x03)  /*!< AF3: I2C1 Alternate Function mapping      */
-#define GPIO_AF3_TIM15        ((uint8_t)0x03)  /*!< AF3: TIM15 Alternate Function mapping     */
-#define GPIO_AF3_TSC          ((uint8_t)0x03)  /*!< AF3: TSC Alternate Function mapping       */
-
-/* AF 4 */
-#define GPIO_AF4_TIM14        ((uint8_t)0x04)  /*!< AF4: TIM14 Alternate Function mapping     */
-
-/* AF 5 */
-#define GPIO_AF5_TIM16        ((uint8_t)0x05)  /*!< AF5: TIM16 Alternate Function mapping     */
-#define GPIO_AF5_TIM17        ((uint8_t)0x05)  /*!< AF5: TIM17 Alternate Function mapping     */
-
-/* AF 6 */
-#define GPIO_AF6_EVENTOUT     ((uint8_t)0x06)  /*!< AF6: EVENTOUT Alternate Function mapping  */
-
-/* AF 7 */
-#define GPIO_AF7_COMP1        ((uint8_t)0x07)  /*!< AF7: COMP1 Alternate Function mapping     */
-#define GPIO_AF7_COMP2        ((uint8_t)0x07)  /*!< AF7: COMP2 Alternate Function mapping     */
-
-#define IS_GPIO_AF(AF)        ((AF) <= (uint8_t)0x07)
-
-#endif /* STM32F051x8/STM32F058xx */
-
-#if defined (STM32F071xB)
-/*--------------------------- STM32F071xB ---------------------------*/
-/* AF 0 */ 
-#define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: AEVENTOUT Alternate Function mapping */
-#define GPIO_AF0_SWDIO        ((uint8_t)0x00)  /*!< AF0: SWDIO Alternate Function mapping     */
-#define GPIO_AF0_SWCLK        ((uint8_t)0x00)  /*!< AF0: SWCLK Alternate Function mapping     */
-#define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
-#define GPIO_AF0_CEC          ((uint8_t)0x00)  /*!< AF0: CEC Alternate Function mapping       */
-#define GPIO_AF0_CRS          ((uint8_t)0x00)  /*!< AF0: CRS Alternate Function mapping       */
-#define GPIO_AF0_IR           ((uint8_t)0x00)  /*!< AF0: IR Alternate Function mapping        */
-#define GPIO_AF0_SPI1         ((uint8_t)0x00)  /*!< AF0: SPI1/I2S1 Alternate Function mapping */
-#define GPIO_AF0_SPI2         ((uint8_t)0x00)  /*!< AF0: SPI2/I2S2 Alternate Function mapping */
-#define GPIO_AF0_TIM1         ((uint8_t)0x00)  /*!< AF0: TIM1 Alternate Function mapping      */
-#define GPIO_AF0_TIM3         ((uint8_t)0x00)  /*!< AF0: TIM3 Alternate Function mapping      */
-#define GPIO_AF0_TIM14        ((uint8_t)0x00)  /*!< AF0: TIM14 Alternate Function mapping     */
-#define GPIO_AF0_TIM15        ((uint8_t)0x00)  /*!< AF0: TIM15 Alternate Function mapping     */
-#define GPIO_AF0_TIM16        ((uint8_t)0x00)  /*!< AF0: TIM16 Alternate Function mapping     */
-#define GPIO_AF0_TIM17        ((uint8_t)0x00)  /*!< AF0: TIM17 Alternate Function mapping     */
-#define GPIO_AF0_TSC          ((uint8_t)0x00)  /*!< AF0: TSC Alternate Function mapping       */
-#define GPIO_AF0_USART1       ((uint8_t)0x00)  /*!< AF0: USART1 Alternate Function mapping    */
-#define GPIO_AF0_USART2       ((uint8_t)0x00)  /*!< AF0: USART2 Alternate Function mapping    */
-#define GPIO_AF0_USART3       ((uint8_t)0x00)  /*!< AF0: USART3 Alternate Function mapping    */
-#define GPIO_AF0_USART4       ((uint8_t)0x00)  /*!< AF0: USART4 Alternate Function mapping    */
-
-/* AF 1 */
-#define GPIO_AF1_TIM3         ((uint8_t)0x01)  /*!< AF1: TIM3 Alternate Function mapping      */
-#define GPIO_AF1_TIM15        ((uint8_t)0x01)  /*!< AF1: TIM15 Alternate Function mapping     */
-#define GPIO_AF1_USART1       ((uint8_t)0x01)  /*!< AF1: USART1 Alternate Function mapping    */
-#define GPIO_AF1_USART2       ((uint8_t)0x01)  /*!< AF1: USART2 Alternate Function mapping    */
-#define GPIO_AF1_USART3       ((uint8_t)0x01)  /*!< AF1: USART3 Alternate Function mapping    */
-#define GPIO_AF1_IR           ((uint8_t)0x01)  /*!< AF1: IR Alternate Function mapping        */
-#define GPIO_AF1_CEC          ((uint8_t)0x01)  /*!< AF1: CEC Alternate Function mapping       */
-#define GPIO_AF1_EVENTOUT     ((uint8_t)0x01)  /*!< AF1: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF1_I2C1         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_I2C2         ((uint8_t)0x01)  /*!< AF1: I2C2 Alternate Function mapping      */
-#define GPIO_AF1_TSC          ((uint8_t)0x01)  /*!< AF1: TSC Alternate Function mapping       */
-#define GPIO_AF1_SPI1         ((uint8_t)0x01)  /*!< AF1: SPI1 Alternate Function mapping      */
-#define GPIO_AF1_SPI2         ((uint8_t)0x01)  /*!< AF1: SPI2 Alternate Function mapping      */
-
-/* AF 2 */
-#define GPIO_AF2_TIM1         ((uint8_t)0x02)  /*!< AF2: TIM1 Alternate Function mapping      */
-#define GPIO_AF2_TIM2         ((uint8_t)0x02)  /*!< AF2: TIM2 Alternate Function mapping      */
-#define GPIO_AF2_TIM16        ((uint8_t)0x02)  /*!< AF2: TIM16 Alternate Function mapping     */
-#define GPIO_AF2_TIM17        ((uint8_t)0x02)  /*!< AF2: TIM17 Alternate Function mapping     */
-#define GPIO_AF2_EVENTOUT     ((uint8_t)0x02)  /*!< AF2: EVENTOUT Alternate Function mapping  */
-
-/* AF 3 */
-#define GPIO_AF3_EVENTOUT     ((uint8_t)0x03)  /*!< AF3: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF3_TSC          ((uint8_t)0x03)  /*!< AF3: TSC Alternate Function mapping       */
-#define GPIO_AF3_TIM15        ((uint8_t)0x03)  /*!< AF3: TIM15 Alternate Function mapping     */
-#define GPIO_AF3_I2C1         ((uint8_t)0x03)  /*!< AF3: I2C1 Alternate Function mapping      */
-
-/* AF 4 */
-#define GPIO_AF4_TIM14        ((uint8_t)0x04)  /*!< AF4: TIM14 Alternate Function mapping     */
-#define GPIO_AF4_USART4       ((uint8_t)0x04)  /*!< AF4: USART4 Alternate Function mapping    */
-#define GPIO_AF4_USART3       ((uint8_t)0x04)  /*!< AF4: USART3 Alternate Function mapping    */
-#define GPIO_AF4_CRS          ((uint8_t)0x04)  /*!< AF4: CRS Alternate Function mapping       */
-
-/* AF 5 */
-#define GPIO_AF5_TIM15        ((uint8_t)0x05)  /*!< AF5: TIM15 Alternate Function mapping     */
-#define GPIO_AF5_TIM16        ((uint8_t)0x05)  /*!< AF5: TIM16 Alternate Function mapping     */
-#define GPIO_AF5_TIM17        ((uint8_t)0x05)  /*!< AF5: TIM17 Alternate Function mapping     */
-#define GPIO_AF5_SPI2         ((uint8_t)0x05)  /*!< AF5: SPI2 Alternate Function mapping      */
-#define GPIO_AF5_I2C2         ((uint8_t)0x05)  /*!< AF5: I2C2 Alternate Function mapping      */
-
-/* AF 6 */
-#define GPIO_AF6_EVENTOUT     ((uint8_t)0x06)  /*!< AF6: EVENTOUT Alternate Function mapping  */
-
-/* AF 7 */
-#define GPIO_AF7_COMP1        ((uint8_t)0x07)  /*!< AF7: COMP1 Alternate Function mapping     */
-#define GPIO_AF7_COMP2        ((uint8_t)0x07)  /*!< AF7: COMP2 Alternate Function mapping     */
-
-#define IS_GPIO_AF(AF)        ((AF) <= (uint8_t)0x07)
-
-#endif /* STM32F071xB */
-
-
-#if defined(STM32F091xC) || defined(STM32F098xx)
-/*--------------------------- STM32F091xC || STM32F098xx ------------------------------*/
-/* AF 0 */
-#define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF0_SWDIO        ((uint8_t)0x00)  /*!< AF0: SWDIO Alternate Function mapping     */
-#define GPIO_AF0_SWCLK        ((uint8_t)0x00)  /*!< AF0: SWCLK Alternate Function mapping     */
-#define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
-#define GPIO_AF0_CEC          ((uint8_t)0x00)  /*!< AF0: CEC Alternate Function mapping       */
-#define GPIO_AF0_CRS          ((uint8_t)0x00)  /*!< AF0: CRS Alternate Function mapping       */
-#define GPIO_AF0_IR           ((uint8_t)0x00)  /*!< AF0: IR Alternate Function mapping        */
-#define GPIO_AF0_SPI1         ((uint8_t)0x00)  /*!< AF0: SPI1/I2S1 Alternate Function mapping */
-#define GPIO_AF0_SPI2         ((uint8_t)0x00)  /*!< AF0: SPI2/I2S2 Alternate Function mapping */
-#define GPIO_AF0_TIM1         ((uint8_t)0x00)  /*!< AF0: TIM1 Alternate Function mapping      */
-#define GPIO_AF0_TIM3         ((uint8_t)0x00)  /*!< AF0: TIM3 Alternate Function mapping      */
-#define GPIO_AF0_TIM14        ((uint8_t)0x00)  /*!< AF0: TIM14 Alternate Function mapping     */
-#define GPIO_AF0_TIM15        ((uint8_t)0x00)  /*!< AF0: TIM15 Alternate Function mapping     */
-#define GPIO_AF0_TIM16        ((uint8_t)0x00)  /*!< AF0: TIM16 Alternate Function mapping     */
-#define GPIO_AF0_TIM17        ((uint8_t)0x00)  /*!< AF0: TIM17 Alternate Function mapping     */
-#define GPIO_AF0_TSC          ((uint8_t)0x00)  /*!< AF0: TSC Alternate Function mapping       */
-#define GPIO_AF0_USART1       ((uint8_t)0x00)  /*!< AF0: USART1 Alternate Function mapping    */
-#define GPIO_AF0_USART2       ((uint8_t)0x00)  /*!< AF0: USART2 Alternate Function mapping    */
-#define GPIO_AF0_USART3       ((uint8_t)0x00)  /*!< AF0: USART3 Alternate Function mapping    */
-#define GPIO_AF0_USART4       ((uint8_t)0x00)  /*!< AF0: USART4 Alternate Function mapping    */
-#define GPIO_AF0_USART8       ((uint8_t)0x00)  /*!< AF0: USART8 Alternate Function mapping    */
-#define GPIO_AF0_CAN          ((uint8_t)0x00)  /*!< AF0: CAN Alternate Function mapping       */
-
-/* AF 1 */
-#define GPIO_AF1_TIM3         ((uint8_t)0x01)  /*!< AF1: TIM3 Alternate Function mapping      */
-#define GPIO_AF1_TIM15        ((uint8_t)0x01)  /*!< AF1: TIM15 Alternate Function mapping     */
-#define GPIO_AF1_USART1       ((uint8_t)0x01)  /*!< AF1: USART1 Alternate Function mapping    */
-#define GPIO_AF1_USART2       ((uint8_t)0x01)  /*!< AF1: USART2 Alternate Function mapping    */
-#define GPIO_AF1_USART3       ((uint8_t)0x01)  /*!< AF1: USART3 Alternate Function mapping    */
-#define GPIO_AF1_USART4       ((uint8_t)0x01)  /*!< AF1: USART4 Alternate Function mapping    */
-#define GPIO_AF1_USART5       ((uint8_t)0x01)  /*!< AF1: USART5 Alternate Function mapping    */
-#define GPIO_AF1_USART6       ((uint8_t)0x01)  /*!< AF1: USART6 Alternate Function mapping    */
-#define GPIO_AF1_USART7       ((uint8_t)0x01)  /*!< AF1: USART7 Alternate Function mapping    */
-#define GPIO_AF1_USART8       ((uint8_t)0x01)  /*!< AF1: USART8 Alternate Function mapping    */
-#define GPIO_AF1_IR           ((uint8_t)0x01)  /*!< AF1: IR Alternate Function mapping        */
-#define GPIO_AF1_CEC          ((uint8_t)0x01)  /*!< AF1: CEC Alternate Function mapping       */
-#define GPIO_AF1_EVENTOUT     ((uint8_t)0x01)  /*!< AF1: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF1_I2C1         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_I2C2         ((uint8_t)0x01)  /*!< AF1: I2C2 Alternate Function mapping      */
-#define GPIO_AF1_TSC          ((uint8_t)0x01)  /*!< AF1: TSC Alternate Function mapping       */
-#define GPIO_AF1_SPI1         ((uint8_t)0x01)  /*!< AF1: SPI1 Alternate Function mapping      */
-#define GPIO_AF1_SPI2         ((uint8_t)0x01)  /*!< AF1: SPI2 Alternate Function mapping      */
-
-/* AF 2 */
-#define GPIO_AF2_TIM1         ((uint8_t)0x02)  /*!< AF2: TIM1 Alternate Function mapping      */
-#define GPIO_AF2_TIM2         ((uint8_t)0x02)  /*!< AF2: TIM2 Alternate Function mapping      */
-#define GPIO_AF2_TIM16        ((uint8_t)0x02)  /*!< AF2: TIM16 Alternate Function mapping     */
-#define GPIO_AF2_TIM17        ((uint8_t)0x02)  /*!< AF2: TIM17 Alternate Function mapping     */
-#define GPIO_AF2_EVENTOUT     ((uint8_t)0x02)  /*!< AF2: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF2_USART5       ((uint8_t)0x02)  /*!< AF2: USART5 Alternate Function mapping    */
-#define GPIO_AF2_USART6       ((uint8_t)0x02)  /*!< AF2: USART6 Alternate Function mapping    */
-#define GPIO_AF2_USART7       ((uint8_t)0x02)  /*!< AF2: USART7 Alternate Function mapping    */
-#define GPIO_AF2_USART8       ((uint8_t)0x02)  /*!< AF2: USART8 Alternate Function mapping    */
-
-/* AF 3 */
-#define GPIO_AF3_EVENTOUT     ((uint8_t)0x03)  /*!< AF3: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF3_TSC          ((uint8_t)0x03)  /*!< AF3: TSC Alternate Function mapping       */
-#define GPIO_AF3_TIM15        ((uint8_t)0x03)  /*!< AF3: TIM15 Alternate Function mapping     */
-#define GPIO_AF3_I2C1         ((uint8_t)0x03)  /*!< AF3: I2C1 Alternate Function mapping      */
-
-/* AF 4 */
-#define GPIO_AF4_TIM14        ((uint8_t)0x04)  /*!< AF4: TIM14 Alternate Function mapping     */
-#define GPIO_AF4_USART4       ((uint8_t)0x04)  /*!< AF4: USART4 Alternate Function mapping    */
-#define GPIO_AF4_USART3       ((uint8_t)0x04)  /*!< AF4: USART3 Alternate Function mapping    */
-#define GPIO_AF4_CRS          ((uint8_t)0x04)  /*!< AF4: CRS Alternate Function mapping       */
-#define GPIO_AF4_CAN          ((uint8_t)0x04)  /*!< AF4: CAN Alternate Function mapping       */
-#define GPIO_AF4_I2C1         ((uint8_t)0x04)  /*!< AF4: I2C1 Alternate Function mapping      */
-#define GPIO_AF4_USART5       ((uint8_t)0x04)  /*!< AF4: USART5 Alternate Function mapping    */
-
-/* AF 5 */
-#define GPIO_AF5_TIM15        ((uint8_t)0x05)  /*!< AF5: TIM15 Alternate Function mapping     */
-#define GPIO_AF5_TIM16        ((uint8_t)0x05)  /*!< AF5: TIM16 Alternate Function mapping     */
-#define GPIO_AF5_TIM17        ((uint8_t)0x05)  /*!< AF5: TIM17 Alternate Function mapping     */
-#define GPIO_AF5_SPI2         ((uint8_t)0x05)  /*!< AF5: SPI2 Alternate Function mapping      */
-#define GPIO_AF5_I2C2         ((uint8_t)0x05)  /*!< AF5: I2C2 Alternate Function mapping      */
-#define GPIO_AF5_MCO          ((uint8_t)0x05)  /*!< AF5: MCO Alternate Function mapping       */
-#define GPIO_AF5_USART6       ((uint8_t)0x05)  /*!< AF5: USART6 Alternate Function mapping    */
-
-/* AF 6 */
-#define GPIO_AF6_EVENTOUT     ((uint8_t)0x06)  /*!< AF6: EVENTOUT Alternate Function mapping  */
-
-/* AF 7 */
-#define GPIO_AF7_COMP1        ((uint8_t)0x07)  /*!< AF7: COMP1 Alternate Function mapping     */
-#define GPIO_AF7_COMP2        ((uint8_t)0x07)  /*!< AF7: COMP2 Alternate Function mapping     */
-
-#define IS_GPIO_AF(AF)        ((AF) <= (uint8_t)0x07)
-
-#endif /* STM32F091xC  || STM32F098xx */
-
-#if defined (STM32F072xB) || defined (STM32F078xx)
-/*--------------------------- STM32F072xB/STM32F078xx ---------------------------*/
-/* AF 0 */
-#define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF0_SWDIO        ((uint8_t)0x00)  /*!< AF0: SWDIO Alternate Function mapping     */
-#define GPIO_AF0_SWCLK        ((uint8_t)0x00)  /*!< AF0: SWCLK Alternate Function mapping     */
-#define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
-#define GPIO_AF0_CEC          ((uint8_t)0x00)  /*!< AF0: CEC Alternate Function mapping       */
-#define GPIO_AF0_CRS          ((uint8_t)0x00)  /*!< AF0: CRS Alternate Function mapping       */
-#define GPIO_AF0_IR           ((uint8_t)0x00)  /*!< AF0: IR Alternate Function mapping        */
-#define GPIO_AF0_SPI1         ((uint8_t)0x00)  /*!< AF0: SPI1/I2S1 Alternate Function mapping */
-#define GPIO_AF0_SPI2         ((uint8_t)0x00)  /*!< AF0: SPI2/I2S2 Alternate Function mapping */
-#define GPIO_AF0_TIM1         ((uint8_t)0x00)  /*!< AF0: TIM1 Alternate Function mapping      */
-#define GPIO_AF0_TIM3         ((uint8_t)0x00)  /*!< AF0: TIM3 Alternate Function mapping      */
-#define GPIO_AF0_TIM14        ((uint8_t)0x00)  /*!< AF0: TIM14 Alternate Function mapping     */
-#define GPIO_AF0_TIM15        ((uint8_t)0x00)  /*!< AF0: TIM15 Alternate Function mapping     */
-#define GPIO_AF0_TIM16        ((uint8_t)0x00)  /*!< AF0: TIM16 Alternate Function mapping     */
-#define GPIO_AF0_TIM17        ((uint8_t)0x00)  /*!< AF0: TIM17 Alternate Function mapping     */
-#define GPIO_AF0_TSC          ((uint8_t)0x00)  /*!< AF0: TSC Alternate Function mapping       */
-#define GPIO_AF0_USART1       ((uint8_t)0x00)  /*!< AF0: USART1 Alternate Function mapping    */
-#define GPIO_AF0_USART2       ((uint8_t)0x00)  /*!< AF0: USART2 Alternate Function mapping    */
-#define GPIO_AF0_USART3       ((uint8_t)0x00)  /*!< AF0: USART2 Alternate Function mapping    */
-#define GPIO_AF0_USART4       ((uint8_t)0x00)  /*!< AF0: USART4 Alternate Function mapping    */
-#define GPIO_AF0_CAN          ((uint8_t)0x00)  /*!< AF0: CAN Alternate Function mapping       */
-
-/* AF 1 */
-#define GPIO_AF1_TIM3         ((uint8_t)0x01)  /*!< AF1: TIM3 Alternate Function mapping      */
-#define GPIO_AF1_TIM15        ((uint8_t)0x01)  /*!< AF1: TIM15 Alternate Function mapping     */
-#define GPIO_AF1_USART1       ((uint8_t)0x01)  /*!< AF1: USART1 Alternate Function mapping    */
-#define GPIO_AF1_USART2       ((uint8_t)0x01)  /*!< AF1: USART2 Alternate Function mapping    */
-#define GPIO_AF1_USART3       ((uint8_t)0x01)  /*!< AF1: USART3 Alternate Function mapping    */
-#define GPIO_AF1_IR           ((uint8_t)0x01)  /*!< AF1: IR Alternate Function mapping        */
-#define GPIO_AF1_CEC          ((uint8_t)0x01)  /*!< AF1: CEC Alternate Function mapping       */
-#define GPIO_AF1_EVENTOUT     ((uint8_t)0x01)  /*!< AF1: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF1_I2C1         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_I2C2         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_TSC          ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_SPI1         ((uint8_t)0x01)  /*!< AF1: SPI1 Alternate Function mapping      */
-#define GPIO_AF1_SPI2         ((uint8_t)0x01)  /*!< AF1: SPI2 Alternate Function mapping      */
-
-/* AF 2 */
-#define GPIO_AF2_TIM1         ((uint8_t)0x02)  /*!< AF2: TIM1 Alternate Function mapping      */
-#define GPIO_AF2_TIM2         ((uint8_t)0x02)  /*!< AF2: TIM2 Alternate Function mapping      */
-#define GPIO_AF2_TIM16        ((uint8_t)0x02)  /*!< AF2: TIM16 Alternate Function mapping     */
-#define GPIO_AF2_TIM17        ((uint8_t)0x02)  /*!< AF2: TIM17 Alternate Function mapping     */
-#define GPIO_AF2_EVENTOUT     ((uint8_t)0x02)  /*!< AF2: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF2_USB          ((uint8_t)0x02)  /*!< AF2: USB Alternate Function mapping       */
-
-/* AF 3 */
-#define GPIO_AF3_EVENTOUT     ((uint8_t)0x03)  /*!< AF3: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF3_TSC          ((uint8_t)0x03)  /*!< AF3: TSC Alternate Function mapping       */
-#define GPIO_AF3_TIM15        ((uint8_t)0x03)  /*!< AF3: TIM15 Alternate Function mapping     */
-#define GPIO_AF3_I2C1         ((uint8_t)0x03)  /*!< AF3: I2C1 Alternate Function mapping      */
-
-/* AF 4 */
-#define GPIO_AF4_TIM14        ((uint8_t)0x04)  /*!< AF4: TIM14 Alternate Function mapping     */
-#define GPIO_AF4_USART4       ((uint8_t)0x04)  /*!< AF4: USART4 Alternate Function mapping    */
-#define GPIO_AF4_USART3       ((uint8_t)0x04)  /*!< AF4: USART3 Alternate Function mapping    */
-#define GPIO_AF4_CRS          ((uint8_t)0x04)  /*!< AF4: CRS Alternate Function mapping       */
-#define GPIO_AF4_CAN          ((uint8_t)0x04)  /*!< AF4: CAN Alternate Function mapping       */
-
-/* AF 5 */
-#define GPIO_AF5_TIM15        ((uint8_t)0x05)  /*!< AF5: TIM15 Alternate Function mapping     */
-#define GPIO_AF5_TIM16        ((uint8_t)0x05)  /*!< AF5: TIM16 Alternate Function mapping     */
-#define GPIO_AF5_TIM17        ((uint8_t)0x05)  /*!< AF5: TIM17 Alternate Function mapping     */
-#define GPIO_AF5_SPI2         ((uint8_t)0x05)  /*!< AF5: SPI2 Alternate Function mapping      */
-#define GPIO_AF5_I2C2         ((uint8_t)0x05)  /*!< AF5: I2C2 Alternate Function mapping      */
-
-/* AF 6 */
-#define GPIO_AF6_EVENTOUT     ((uint8_t)0x06)  /*!< AF6: EVENTOUT Alternate Function mapping  */
-
-/* AF 7 */
-#define GPIO_AF7_COMP1        ((uint8_t)0x07)  /*!< AF7: COMP1 Alternate Function mapping     */
-#define GPIO_AF7_COMP2        ((uint8_t)0x07)  /*!< AF7: COMP2 Alternate Function mapping     */
-
-#define IS_GPIO_AF(AF)        ((AF) <= (uint8_t)0x07)
-
-#endif /* STM32F072xB || STM32F078xx */
-
-#if defined (STM32F042x6) || defined (STM32F048xx)
-/*--------------------------- STM32F042x6/STM32F048xx ---------------------------*/
-/* AF 0 */
-#define GPIO_AF0_EVENTOUT     ((uint8_t)0x00)  /*!< AF0: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF0_CEC          ((uint8_t)0x00)  /*!< AF0: CEC Alternate Function mapping       */
-#define GPIO_AF0_CRS          ((uint8_t)0x00)  /*!< AF0: CRS Alternate Function mapping       */
-#define GPIO_AF0_IR           ((uint8_t)0x00)  /*!< AF0: IR Alternate Function mapping        */
-#define GPIO_AF0_MCO          ((uint8_t)0x00)  /*!< AF0: MCO Alternate Function mapping       */
-#define GPIO_AF0_SPI1         ((uint8_t)0x00)  /*!< AF0: SPI1/I2S1 Alternate Function mapping */
-#define GPIO_AF0_SPI2         ((uint8_t)0x00)  /*!< AF0: SPI2/I2S2 Alternate Function mapping */
-#define GPIO_AF0_SWDIO        ((uint8_t)0x00)  /*!< AF0: SWDIO Alternate Function mapping     */
-#define GPIO_AF0_SWCLK        ((uint8_t)0x00)  /*!< AF0: SWCLK Alternate Function mapping     */
-#define GPIO_AF0_TIM14        ((uint8_t)0x00)  /*!< AF0: TIM14 Alternate Function mapping     */
-#define GPIO_AF0_TIM17        ((uint8_t)0x00)  /*!< AF0: TIM17 Alternate Function mapping     */
-#define GPIO_AF0_USART1       ((uint8_t)0x00)  /*!< AF0: USART1 Alternate Function mapping    */
-
-/* AF 1 */
-#define GPIO_AF1_CEC          ((uint8_t)0x01)  /*!< AF1: CEC Alternate Function mapping       */
-#define GPIO_AF1_EVENTOUT     ((uint8_t)0x01)  /*!< AF1: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF1_I2C1         ((uint8_t)0x01)  /*!< AF1: I2C1 Alternate Function mapping      */
-#define GPIO_AF1_IR           ((uint8_t)0x01)  /*!< AF1: IR Alternate Function mapping        */
-#define GPIO_AF1_USART1       ((uint8_t)0x01)  /*!< AF1: USART1 Alternate Function mapping    */
-#define GPIO_AF1_USART2       ((uint8_t)0x01)  /*!< AF1: USART2 Alternate Function mapping    */
-#define GPIO_AF1_TIM3         ((uint8_t)0x01)  /*!< AF1: TIM3 Alternate Function mapping      */
-
-/* AF 2 */
-#define GPIO_AF2_EVENTOUT     ((uint8_t)0x02)  /*!< AF2: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF2_TIM1         ((uint8_t)0x02)  /*!< AF2: TIM1 Alternate Function mapping      */
-#define GPIO_AF2_TIM2         ((uint8_t)0x02)  /*!< AF2: TIM2 Alternate Function mapping      */
-#define GPIO_AF2_TIM16        ((uint8_t)0x02)  /*!< AF2: TIM16 Alternate Function mapping     */
-#define GPIO_AF2_TIM17        ((uint8_t)0x02)  /*!< AF2: TIM17 Alternate Function mapping     */
-#define GPIO_AF2_USB          ((uint8_t)0x02)  /*!< AF2: USB Alternate Function mapping       */
-
-/* AF 3 */
-#define GPIO_AF3_EVENTOUT     ((uint8_t)0x03)  /*!< AF3: EVENTOUT Alternate Function mapping  */
-#define GPIO_AF3_I2C1         ((uint8_t)0x03)  /*!< AF3: I2C1 Alternate Function mapping      */
-#define GPIO_AF3_TSC          ((uint8_t)0x03)  /*!< AF3: TSC Alternate Function mapping       */
-
-/* AF 4 */
-#define GPIO_AF4_TIM14        ((uint8_t)0x04)  /*!< AF4: TIM14 Alternate Function mapping     */
-#define GPIO_AF4_CAN          ((uint8_t)0x04)  /*!< AF4: CAN Alternate Function mapping       */
-#define GPIO_AF4_CRS          ((uint8_t)0x04)  /*!< AF4: CRS Alternate Function mapping       */
-#define GPIO_AF4_I2C1         ((uint8_t)0x04)  /*!< AF4: I2C1 Alternate Function mapping      */
-
-/* AF 5 */ 
-#define GPIO_AF5_MCO          ((uint8_t)0x05)  /*!< AF5: MCO Alternate Function mapping       */
-#define GPIO_AF5_I2C1         ((uint8_t)0x05)  /*!< AF5: I2C1 Alternate Function mapping      */
-#define GPIO_AF5_I2C2         ((uint8_t)0x05)  /*!< AF5: I2C2 Alternate Function mapping      */
-#define GPIO_AF5_SPI2         ((uint8_t)0x05)  /*!< AF5: SPI2 Alternate Function mapping      */
-#define GPIO_AF5_TIM16        ((uint8_t)0x05)  /*!< AF5: TIM16 Alternate Function mapping     */
-#define GPIO_AF5_TIM17        ((uint8_t)0x05)  /*!< AF5: TIM17 Alternate Function mapping     */
-#define GPIO_AF5_USB          ((uint8_t)0x05)  /*!< AF5: USB Alternate Function mapping       */
-
-/* AF 6 */ 
-#define GPIO_AF6_EVENTOUT     ((uint8_t)0x06)  /*!< AF6: EVENTOUT Alternate Function mapping  */
-
-#define IS_GPIO_AF(AF)        ((AF) <= (uint8_t)0x06)
-
-#endif /* STM32F042x6 || STM32F048xx */
 /**
   * @}
   */ 
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/i2c_api.c	Mon Nov 10 01:43:37 2014 +0000
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/i2c_api.c	Mon Nov 10 05:43:20 2014 +0000
@@ -41,6 +41,7 @@
 #define FLAG_TIMEOUT ((int)0x1000)
 #define LONG_TIMEOUT ((int)0x8000)
 
+/* STM32F030R8 - Nucleo
 static const PinMap PinMap_I2C_SDA[] = {
     {PB_7,  I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
     {PB_9,  I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
@@ -54,6 +55,21 @@
     {PB_10, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C2)},
     {NC,    NC,    0}
 };
+*/
+
+// STM32F030F4
+static const PinMap PinMap_I2C_SDA[] = {
+    {PA_10,  I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+    {NC,    NC,    0}
+};
+
+static const PinMap PinMap_I2C_SCL[] = {
+    {PA_9,  I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+    {NC,    NC,    0}
+};
+//
+
+
 
 I2C_HandleTypeDef I2cHandle;
 
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/pwmout_api.c	Mon Nov 10 01:43:37 2014 +0000
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/pwmout_api.c	Mon Nov 10 05:43:20 2014 +0000
@@ -39,6 +39,8 @@
 // Uncomment/comment line above to use an alternate timer, 
 // If the channel is not the same, 
 // Please don't forget to uncomment/comment in the pwmout_write() function also
+
+/* STM32F030R8 - Nucleo
 static const PinMap PinMap_PWM[] = {
     {PA_4,  PWM_14, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_TIM14)}, // TIM14_CH1
     {PA_6,  PWM_3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM3)},  // TIM3_CH1
@@ -64,6 +66,25 @@
     {PC_9,  PWM_3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM3)},  // TIM3_CH4
     {NC,    NC,    0}
 };
+*/
+
+
+// STM32F030F4
+static const PinMap PinMap_PWM[] = {
+    {PA_4,  PWM_14, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_TIM14)}, // TIM14_CH1
+//    {PA_6,  PWM_3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM3)},  // TIM3_CH1
+    {PA_6,  PWM_16, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_TIM16)}, // TIM16_CH1
+//    {PA_7,  PWM_3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM3)},  // TIM3_CH2
+//    {PA_7,  PWM_14, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_TIM14)}, // TIM14_CH1
+    {PA_7,  PWM_17, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_TIM17)}, // TIM17_CH1
+//    {PB_1,  PWM_14, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_TIM14)}, // TIM14_CH1
+    {PB_1,  PWM_3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF1_TIM3)},  // TIM3_CH4
+    {NC,    NC,    0}
+};
+//
+
+
+
 
 static TIM_HandleTypeDef TimHandle;
 
@@ -125,8 +146,8 @@
         // Channels 1
         case PA_4:
         case PA_6:
-//      case PA_7:
-        case PB_1:
+        case PA_7:
+//        case PB_1:
         case PB_4:
         case PB_8:
         case PB_9:
@@ -142,7 +163,7 @@
             complementary_channel = 1;
             break;
         // Channels 2
-        case PA_7:					
+//        case PA_7:					
         case PB_5:
         case PB_15:
         case PC_7:
@@ -154,7 +175,7 @@
             channel = TIM_CHANNEL_3;
             break;
         // Channels 4
-//      case PB_1:
+        case PB_1:
         case PC_9:
             channel = TIM_CHANNEL_4;
             break;
@@ -198,7 +219,7 @@
     SystemCoreClockUpdate();
 
     TimHandle.Init.Period        = us - 1;
-    TimHandle.Init.Prescaler     = (uint16_t)(SystemCoreClock / 1000000) - 1; // 1 µs tick
+    TimHandle.Init.Prescaler     = (uint16_t)(SystemCoreClock / 1000000) - 1; // 1 �s tick
     TimHandle.Init.ClockDivision = 0;
     TimHandle.Init.CounterMode   = TIM_COUNTERMODE_UP;
     HAL_TIM_PWM_Init(&TimHandle);
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/serial_api.c	Mon Nov 10 01:43:37 2014 +0000
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/serial_api.c	Mon Nov 10 05:43:20 2014 +0000
@@ -36,6 +36,7 @@
 #include "pinmap.h"
 #include <string.h>
 
+/* STM32F030R8 - Nucleo
 static const PinMap PinMap_UART_TX[] = {
     {PA_2,  UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
     {PA_9,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
@@ -50,6 +51,24 @@
     {PB_7,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)},
     {NC,    NC,     0}
 };
+*/
+
+// STM32F030F4
+static const PinMap PinMap_UART_TX[] = {
+    {PA_2,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
+    {PA_9,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
+    {PA_14,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
+    {NC,    NC,     0}
+};
+
+static const PinMap PinMap_UART_RX[] = {
+    {PA_3,  UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
+    {PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
+    {NC,    NC,     0}
+};
+//
+
+
 
 #define UART_NUM (2)
 
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/spi_api.c	Mon Nov 10 01:43:37 2014 +0000
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/spi_api.c	Mon Nov 10 05:43:20 2014 +0000
@@ -36,6 +36,8 @@
 #include "cmsis.h"
 #include "pinmap.h"
 
+
+/* STM32F030R8
 static const PinMap PinMap_SPI_MOSI[] = {
     {PA_7,  SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)},
     {PB_5,  SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)},
@@ -63,6 +65,33 @@
     {PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)},
     {NC,    NC,    0}
 };
+*/
+
+
+// STM32F030F4
+static const PinMap PinMap_SPI_MOSI[] = {
+    {PA_7,  SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)},
+    {NC,    NC,    0}
+};
+
+static const PinMap PinMap_SPI_MISO[] = {
+    {PA_6,  SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)},
+    {NC,    NC,    0}
+};
+
+static const PinMap PinMap_SPI_SCLK[] = {
+    {PA_5,  SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)},
+    {NC,    NC,    0}
+};
+
+static const PinMap PinMap_SPI_SSEL[] = {
+    {PA_4,  SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)},
+    {NC,    NC,    0}
+};
+//
+
+
+
 
 static SPI_HandleTypeDef SpiHandle;