mbed library sources for small microcontrollers such as STM32F050F6P6 (with 4 kB RAM)

Dependents:   STM32F031_blink_LED_1

Fork of mbed-src by mbed official

Revision:
482:d9a48e768ce0
Parent:
441:d2c15dda23c1
--- a/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/ethernet_api.c	Thu Feb 26 09:30:08 2015 +0000
+++ b/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/ethernet_api.c	Fri Feb 27 10:00:08 2015 +0000
@@ -27,7 +27,6 @@
 #define NUM_OF_RX_DESCRIPTOR    (16)
 #define SIZE_OF_BUFFER          (1600)     /* Must be an integral multiple of 32 */
 #define MAX_SEND_SIZE           (1514)
-#define BUFF_BOUNDARY_MSK       (0x0000000F)
 /* Ethernet Descriptor Value Define */
 #define TD0_TFP_TOP_BOTTOM      (0x30000000)
 #define TD0_TACT                (0x80000000)
@@ -105,14 +104,13 @@
 } edmac_recv_desc_t;
 
 /* memory */
-#pragma arm section zidata="NC_BSS"
 /* The whole transmit/receive descriptors (must be allocated in 16-byte boundaries) */
 /* Transmit/receive buffers (must be allocated in 16-byte boundaries) */
 static uint8_t ehernet_nc_memory[(sizeof(edmac_send_desc_t) * NUM_OF_TX_DESCRIPTOR) +
                                  (sizeof(edmac_recv_desc_t) * NUM_OF_RX_DESCRIPTOR) +
                                  (NUM_OF_TX_DESCRIPTOR * SIZE_OF_BUFFER) +
-                                 (NUM_OF_RX_DESCRIPTOR * SIZE_OF_BUFFER) + BUFF_BOUNDARY_MSK];
-#pragma arm section zidata
+                                 (NUM_OF_RX_DESCRIPTOR * SIZE_OF_BUFFER)]
+                                 __attribute((section("NC_BSS"),aligned(16)));  //16 bytes aligned!
 static int32_t            rx_read_offset;   /* read offset */
 static int32_t            tx_wite_offset;   /* write offset */
 static uint32_t           send_top_index;
@@ -489,7 +487,7 @@
     uint8_t *p_memory_top;
 
     (void)memset((void *)ehernet_nc_memory, 0, sizeof(ehernet_nc_memory));
-    p_memory_top = (uint8_t *)(((uint32_t)ehernet_nc_memory + BUFF_BOUNDARY_MSK) & ~BUFF_BOUNDARY_MSK);
+    p_memory_top = ehernet_nc_memory;
 
     /* Descriptor area configuration */
     p_eth_desc_dsend  = (edmac_send_desc_t *)p_memory_top;