TEST
Dependencies: max32630fthr Adafruit_FeatherOLED USBDevice
patches/0001-porting-MAX32625PICO-to-mbed-os-5.patch@4:291477e8690d, 2020-04-19 (annotated)
- Committer:
- wwwarunraj
- Date:
- Sun Apr 19 11:19:57 2020 +0000
- Revision:
- 4:291477e8690d
- Parent:
- 1:f60eafbf009a
19/04
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gmehmet | 1:f60eafbf009a | 1 | From 0420b36056436f6f7b387b614de8ab9e0aa0f373 Mon Sep 17 00:00:00 2001 |
gmehmet | 1:f60eafbf009a | 2 | From: Mahir Ozturk <Mahir.Ozturk@maximintegrated.com> |
gmehmet | 1:f60eafbf009a | 3 | Date: Wed, 29 Mar 2017 14:16:50 +0300 |
gmehmet | 1:f60eafbf009a | 4 | Subject: [PATCH] porting MAX32625PICO to mbed-os 5 |
gmehmet | 1:f60eafbf009a | 5 | |
gmehmet | 1:f60eafbf009a | 6 | --- |
gmehmet | 1:f60eafbf009a | 7 | .../TARGET_MAX32625PICO/PeripheralNames.h | 88 +++++++++++ |
gmehmet | 1:f60eafbf009a | 8 | .../TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h | 140 ++++++++++++++++ |
gmehmet | 1:f60eafbf009a | 9 | .../TARGET_MAX32625PICO/low_level_init.c | 56 +++++++ |
gmehmet | 1:f60eafbf009a | 10 | .../TARGET_MAX32625PICO/MAX32625.sct | 16 ++ |
gmehmet | 1:f60eafbf009a | 11 | .../TARGET_MAX32625PICO/max32625.ld | 176 +++++++++++++++++++++ |
gmehmet | 1:f60eafbf009a | 12 | .../TOOLCHAIN_IAR/TARGET_MAX32625PICO/MAX32625.icf | 29 ++++ |
gmehmet | 1:f60eafbf009a | 13 | .../TARGET_MAX32625/device/system_max32625.c | 7 + |
gmehmet | 1:f60eafbf009a | 14 | targets/targets.json | 9 ++ |
gmehmet | 1:f60eafbf009a | 15 | 8 files changed, 521 insertions(+) |
gmehmet | 1:f60eafbf009a | 16 | create mode 100644 targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PeripheralNames.h |
gmehmet | 1:f60eafbf009a | 17 | create mode 100644 targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h |
gmehmet | 1:f60eafbf009a | 18 | create mode 100644 targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/low_level_init.c |
gmehmet | 1:f60eafbf009a | 19 | create mode 100644 targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625PICO/MAX32625.sct |
gmehmet | 1:f60eafbf009a | 20 | create mode 100644 targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625PICO/max32625.ld |
gmehmet | 1:f60eafbf009a | 21 | create mode 100644 targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625PICO/MAX32625.icf |
gmehmet | 1:f60eafbf009a | 22 | |
gmehmet | 1:f60eafbf009a | 23 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PeripheralNames.h b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PeripheralNames.h |
gmehmet | 1:f60eafbf009a | 24 | new file mode 100644 |
gmehmet | 1:f60eafbf009a | 25 | index 000000000..4686ef9c9 |
gmehmet | 1:f60eafbf009a | 26 | --- /dev/null |
gmehmet | 1:f60eafbf009a | 27 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PeripheralNames.h |
gmehmet | 1:f60eafbf009a | 28 | @@ -0,0 +1,88 @@ |
gmehmet | 1:f60eafbf009a | 29 | +/******************************************************************************* |
gmehmet | 1:f60eafbf009a | 30 | + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
gmehmet | 1:f60eafbf009a | 31 | + * |
gmehmet | 1:f60eafbf009a | 32 | + * Permission is hereby granted, free of charge, to any person obtaining a |
gmehmet | 1:f60eafbf009a | 33 | + * copy of this software and associated documentation files (the "Software"), |
gmehmet | 1:f60eafbf009a | 34 | + * to deal in the Software without restriction, including without limitation |
gmehmet | 1:f60eafbf009a | 35 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
gmehmet | 1:f60eafbf009a | 36 | + * and/or sell copies of the Software, and to permit persons to whom the |
gmehmet | 1:f60eafbf009a | 37 | + * Software is furnished to do so, subject to the following conditions: |
gmehmet | 1:f60eafbf009a | 38 | + * |
gmehmet | 1:f60eafbf009a | 39 | + * The above copyright notice and this permission notice shall be included |
gmehmet | 1:f60eafbf009a | 40 | + * in all copies or substantial portions of the Software. |
gmehmet | 1:f60eafbf009a | 41 | + * |
gmehmet | 1:f60eafbf009a | 42 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
gmehmet | 1:f60eafbf009a | 43 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
gmehmet | 1:f60eafbf009a | 44 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
gmehmet | 1:f60eafbf009a | 45 | + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
gmehmet | 1:f60eafbf009a | 46 | + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
gmehmet | 1:f60eafbf009a | 47 | + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
gmehmet | 1:f60eafbf009a | 48 | + * OTHER DEALINGS IN THE SOFTWARE. |
gmehmet | 1:f60eafbf009a | 49 | + * |
gmehmet | 1:f60eafbf009a | 50 | + * Except as contained in this notice, the name of Maxim Integrated |
gmehmet | 1:f60eafbf009a | 51 | + * Products, Inc. shall not be used except as stated in the Maxim Integrated |
gmehmet | 1:f60eafbf009a | 52 | + * Products, Inc. Branding Policy. |
gmehmet | 1:f60eafbf009a | 53 | + * |
gmehmet | 1:f60eafbf009a | 54 | + * The mere transfer of this software does not imply any licenses |
gmehmet | 1:f60eafbf009a | 55 | + * of trade secrets, proprietary technology, copyrights, patents, |
gmehmet | 1:f60eafbf009a | 56 | + * trademarks, maskwork rights, or any other form of intellectual |
gmehmet | 1:f60eafbf009a | 57 | + * property whatsoever. Maxim Integrated Products, Inc. retains all |
gmehmet | 1:f60eafbf009a | 58 | + * ownership rights. |
gmehmet | 1:f60eafbf009a | 59 | + ******************************************************************************* |
gmehmet | 1:f60eafbf009a | 60 | + */ |
gmehmet | 1:f60eafbf009a | 61 | + |
gmehmet | 1:f60eafbf009a | 62 | +#ifndef MBED_PERIPHERALNAMES_H |
gmehmet | 1:f60eafbf009a | 63 | +#define MBED_PERIPHERALNAMES_H |
gmehmet | 1:f60eafbf009a | 64 | + |
gmehmet | 1:f60eafbf009a | 65 | +#include "cmsis.h" |
gmehmet | 1:f60eafbf009a | 66 | + |
gmehmet | 1:f60eafbf009a | 67 | +#ifdef __cplusplus |
gmehmet | 1:f60eafbf009a | 68 | +extern "C" { |
gmehmet | 1:f60eafbf009a | 69 | +#endif |
gmehmet | 1:f60eafbf009a | 70 | + |
gmehmet | 1:f60eafbf009a | 71 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 72 | + UART_0 = MXC_BASE_UART0, |
gmehmet | 1:f60eafbf009a | 73 | + UART_1 = MXC_BASE_UART1, |
gmehmet | 1:f60eafbf009a | 74 | + UART_2 = MXC_BASE_UART2, |
gmehmet | 1:f60eafbf009a | 75 | + STDIO_UART = UART_1 |
gmehmet | 1:f60eafbf009a | 76 | +} UARTName; |
gmehmet | 1:f60eafbf009a | 77 | + |
gmehmet | 1:f60eafbf009a | 78 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 79 | + I2C_0 = MXC_BASE_I2CM0, |
gmehmet | 1:f60eafbf009a | 80 | + I2C_1 = MXC_BASE_I2CM1 |
gmehmet | 1:f60eafbf009a | 81 | +} I2CName; |
gmehmet | 1:f60eafbf009a | 82 | + |
gmehmet | 1:f60eafbf009a | 83 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 84 | + SPI_0 = MXC_BASE_SPIM0, |
gmehmet | 1:f60eafbf009a | 85 | + SPI_1 = MXC_BASE_SPIM1, |
gmehmet | 1:f60eafbf009a | 86 | + SPI_2 = MXC_BASE_SPIM2 |
gmehmet | 1:f60eafbf009a | 87 | +} SPIName; |
gmehmet | 1:f60eafbf009a | 88 | + |
gmehmet | 1:f60eafbf009a | 89 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 90 | + PWM_0 = MXC_BASE_PT0, |
gmehmet | 1:f60eafbf009a | 91 | + PWM_1 = MXC_BASE_PT1, |
gmehmet | 1:f60eafbf009a | 92 | + PWM_2 = MXC_BASE_PT2, |
gmehmet | 1:f60eafbf009a | 93 | + PWM_3 = MXC_BASE_PT3, |
gmehmet | 1:f60eafbf009a | 94 | + PWM_4 = MXC_BASE_PT4, |
gmehmet | 1:f60eafbf009a | 95 | + PWM_5 = MXC_BASE_PT5, |
gmehmet | 1:f60eafbf009a | 96 | + PWM_6 = MXC_BASE_PT6, |
gmehmet | 1:f60eafbf009a | 97 | + PWM_7 = MXC_BASE_PT7, |
gmehmet | 1:f60eafbf009a | 98 | + PWM_8 = MXC_BASE_PT8, |
gmehmet | 1:f60eafbf009a | 99 | + PWM_9 = MXC_BASE_PT9, |
gmehmet | 1:f60eafbf009a | 100 | + PWM_10 = MXC_BASE_PT10, |
gmehmet | 1:f60eafbf009a | 101 | + PWM_11 = MXC_BASE_PT11, |
gmehmet | 1:f60eafbf009a | 102 | + PWM_12 = MXC_BASE_PT12, |
gmehmet | 1:f60eafbf009a | 103 | + PWM_13 = MXC_BASE_PT13, |
gmehmet | 1:f60eafbf009a | 104 | + PWM_14 = MXC_BASE_PT14, |
gmehmet | 1:f60eafbf009a | 105 | + PWM_15 = MXC_BASE_PT15 |
gmehmet | 1:f60eafbf009a | 106 | +} PWMName; |
gmehmet | 1:f60eafbf009a | 107 | + |
gmehmet | 1:f60eafbf009a | 108 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 109 | + ADC = MXC_BASE_ADC |
gmehmet | 1:f60eafbf009a | 110 | +} ADCName; |
gmehmet | 1:f60eafbf009a | 111 | + |
gmehmet | 1:f60eafbf009a | 112 | +#ifdef __cplusplus |
gmehmet | 1:f60eafbf009a | 113 | +} |
gmehmet | 1:f60eafbf009a | 114 | +#endif |
gmehmet | 1:f60eafbf009a | 115 | + |
gmehmet | 1:f60eafbf009a | 116 | +#endif |
gmehmet | 1:f60eafbf009a | 117 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h |
gmehmet | 1:f60eafbf009a | 118 | new file mode 100644 |
gmehmet | 1:f60eafbf009a | 119 | index 000000000..1cbd97e37 |
gmehmet | 1:f60eafbf009a | 120 | --- /dev/null |
gmehmet | 1:f60eafbf009a | 121 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/PinNames.h |
gmehmet | 1:f60eafbf009a | 122 | @@ -0,0 +1,140 @@ |
gmehmet | 1:f60eafbf009a | 123 | +/******************************************************************************* |
gmehmet | 1:f60eafbf009a | 124 | + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
gmehmet | 1:f60eafbf009a | 125 | + * |
gmehmet | 1:f60eafbf009a | 126 | + * Permission is hereby granted, free of charge, to any person obtaining a |
gmehmet | 1:f60eafbf009a | 127 | + * copy of this software and associated documentation files (the "Software"), |
gmehmet | 1:f60eafbf009a | 128 | + * to deal in the Software without restriction, including without limitation |
gmehmet | 1:f60eafbf009a | 129 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
gmehmet | 1:f60eafbf009a | 130 | + * and/or sell copies of the Software, and to permit persons to whom the |
gmehmet | 1:f60eafbf009a | 131 | + * Software is furnished to do so, subject to the following conditions: |
gmehmet | 1:f60eafbf009a | 132 | + * |
gmehmet | 1:f60eafbf009a | 133 | + * The above copyright notice and this permission notice shall be included |
gmehmet | 1:f60eafbf009a | 134 | + * in all copies or substantial portions of the Software. |
gmehmet | 1:f60eafbf009a | 135 | + * |
gmehmet | 1:f60eafbf009a | 136 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
gmehmet | 1:f60eafbf009a | 137 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
gmehmet | 1:f60eafbf009a | 138 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
gmehmet | 1:f60eafbf009a | 139 | + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
gmehmet | 1:f60eafbf009a | 140 | + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
gmehmet | 1:f60eafbf009a | 141 | + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
gmehmet | 1:f60eafbf009a | 142 | + * OTHER DEALINGS IN THE SOFTWARE. |
gmehmet | 1:f60eafbf009a | 143 | + * |
gmehmet | 1:f60eafbf009a | 144 | + * Except as contained in this notice, the name of Maxim Integrated |
gmehmet | 1:f60eafbf009a | 145 | + * Products, Inc. shall not be used except as stated in the Maxim Integrated |
gmehmet | 1:f60eafbf009a | 146 | + * Products, Inc. Branding Policy. |
gmehmet | 1:f60eafbf009a | 147 | + * |
gmehmet | 1:f60eafbf009a | 148 | + * The mere transfer of this software does not imply any licenses |
gmehmet | 1:f60eafbf009a | 149 | + * of trade secrets, proprietary technology, copyrights, patents, |
gmehmet | 1:f60eafbf009a | 150 | + * trademarks, maskwork rights, or any other form of intellectual |
gmehmet | 1:f60eafbf009a | 151 | + * property whatsoever. Maxim Integrated Products, Inc. retains all |
gmehmet | 1:f60eafbf009a | 152 | + * ownership rights. |
gmehmet | 1:f60eafbf009a | 153 | + ******************************************************************************* |
gmehmet | 1:f60eafbf009a | 154 | + */ |
gmehmet | 1:f60eafbf009a | 155 | + |
gmehmet | 1:f60eafbf009a | 156 | +#ifndef MBED_PINNAMES_H |
gmehmet | 1:f60eafbf009a | 157 | +#define MBED_PINNAMES_H |
gmehmet | 1:f60eafbf009a | 158 | + |
gmehmet | 1:f60eafbf009a | 159 | +#include "cmsis.h" |
gmehmet | 1:f60eafbf009a | 160 | +#include "gpio_regs.h" |
gmehmet | 1:f60eafbf009a | 161 | + |
gmehmet | 1:f60eafbf009a | 162 | +#ifdef __cplusplus |
gmehmet | 1:f60eafbf009a | 163 | +extern "C" { |
gmehmet | 1:f60eafbf009a | 164 | +#endif |
gmehmet | 1:f60eafbf009a | 165 | + |
gmehmet | 1:f60eafbf009a | 166 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 167 | + PIN_INPUT = 0, /* MXC_V_GPIO_OUT_MODE_HIGH_Z,*/ |
gmehmet | 1:f60eafbf009a | 168 | + PIN_OUTPUT = 1 /* MXC_V_GPIO_OUT_MODE_NORMAL_DRIVE */ |
gmehmet | 1:f60eafbf009a | 169 | +} PinDirection; |
gmehmet | 1:f60eafbf009a | 170 | + |
gmehmet | 1:f60eafbf009a | 171 | +#define PORT_SHIFT 12 |
gmehmet | 1:f60eafbf009a | 172 | +#define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT) |
gmehmet | 1:f60eafbf009a | 173 | +#define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT)) |
gmehmet | 1:f60eafbf009a | 174 | + |
gmehmet | 1:f60eafbf009a | 175 | +#define NOT_CONNECTED (int)0xFFFFFFFF |
gmehmet | 1:f60eafbf009a | 176 | + |
gmehmet | 1:f60eafbf009a | 177 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 178 | + P0_0 = (0 << PORT_SHIFT), P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, |
gmehmet | 1:f60eafbf009a | 179 | + P1_0 = (1 << PORT_SHIFT), P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, |
gmehmet | 1:f60eafbf009a | 180 | + P2_0 = (2 << PORT_SHIFT), P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, |
gmehmet | 1:f60eafbf009a | 181 | + P3_0 = (3 << PORT_SHIFT), P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7, |
gmehmet | 1:f60eafbf009a | 182 | + P4_0 = (4 << PORT_SHIFT), P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7, |
gmehmet | 1:f60eafbf009a | 183 | + |
gmehmet | 1:f60eafbf009a | 184 | + // Analog input pins |
gmehmet | 1:f60eafbf009a | 185 | + AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, AIN_6, AIN_7, AIN_8, AIN_9, |
gmehmet | 1:f60eafbf009a | 186 | + |
gmehmet | 1:f60eafbf009a | 187 | + // LEDs |
gmehmet | 1:f60eafbf009a | 188 | + LED1 = P2_4, |
gmehmet | 1:f60eafbf009a | 189 | + LED2 = P2_5, |
gmehmet | 1:f60eafbf009a | 190 | + LED3 = P2_6, |
gmehmet | 1:f60eafbf009a | 191 | + LED_RED = LED1, |
gmehmet | 1:f60eafbf009a | 192 | + LED_GREEN = LED2, |
gmehmet | 1:f60eafbf009a | 193 | + LED_BLUE = LED3, |
gmehmet | 1:f60eafbf009a | 194 | + |
gmehmet | 1:f60eafbf009a | 195 | + // Push button |
gmehmet | 1:f60eafbf009a | 196 | + SW1 = P2_7, |
gmehmet | 1:f60eafbf009a | 197 | + |
gmehmet | 1:f60eafbf009a | 198 | + // USB bridge connected UART pins |
gmehmet | 1:f60eafbf009a | 199 | + USBTX = P2_1, |
gmehmet | 1:f60eafbf009a | 200 | + USBRX = P2_0, |
gmehmet | 1:f60eafbf009a | 201 | + STDIO_UART_TX = USBTX, |
gmehmet | 1:f60eafbf009a | 202 | + STDIO_UART_RX = USBRX, |
gmehmet | 1:f60eafbf009a | 203 | + |
gmehmet | 1:f60eafbf009a | 204 | + // I2C pins |
gmehmet | 1:f60eafbf009a | 205 | + I2C0_SCL = P1_7, |
gmehmet | 1:f60eafbf009a | 206 | + I2C0_SDA = P1_6, |
gmehmet | 1:f60eafbf009a | 207 | + |
gmehmet | 1:f60eafbf009a | 208 | + I2C1_SCL = P3_5, |
gmehmet | 1:f60eafbf009a | 209 | + I2C1_SDA = P3_4, |
gmehmet | 1:f60eafbf009a | 210 | + |
gmehmet | 1:f60eafbf009a | 211 | + // UART pins |
gmehmet | 1:f60eafbf009a | 212 | + UART0_RX = P0_0, |
gmehmet | 1:f60eafbf009a | 213 | + UART0_TX = P0_1, |
gmehmet | 1:f60eafbf009a | 214 | + UART0_CTS = P0_2, |
gmehmet | 1:f60eafbf009a | 215 | + UART0_RTS = P0_3, |
gmehmet | 1:f60eafbf009a | 216 | + |
gmehmet | 1:f60eafbf009a | 217 | + UART1_RX = P2_0, |
gmehmet | 1:f60eafbf009a | 218 | + UART1_TX = P2_1, |
gmehmet | 1:f60eafbf009a | 219 | + |
gmehmet | 1:f60eafbf009a | 220 | + UART2_RX = P3_0, |
gmehmet | 1:f60eafbf009a | 221 | + UART2_TX = P3_1, |
gmehmet | 1:f60eafbf009a | 222 | + UART2_CTS = P3_2, |
gmehmet | 1:f60eafbf009a | 223 | + UART2_RTS = P3_3, |
gmehmet | 1:f60eafbf009a | 224 | + |
gmehmet | 1:f60eafbf009a | 225 | + // SPI pins |
gmehmet | 1:f60eafbf009a | 226 | + SPI0_SCK = P0_4, |
gmehmet | 1:f60eafbf009a | 227 | + SPI0_MOSI = P0_5, |
gmehmet | 1:f60eafbf009a | 228 | + SPI0_MISO = P0_6, |
gmehmet | 1:f60eafbf009a | 229 | + SPI0_SS = P0_7, |
gmehmet | 1:f60eafbf009a | 230 | + |
gmehmet | 1:f60eafbf009a | 231 | + SPI1_SCK = P1_0, |
gmehmet | 1:f60eafbf009a | 232 | + SPI1_MOSI = P1_1, |
gmehmet | 1:f60eafbf009a | 233 | + SPI1_MISO = P1_2, |
gmehmet | 1:f60eafbf009a | 234 | + SPI1_SS = P1_3, |
gmehmet | 1:f60eafbf009a | 235 | + |
gmehmet | 1:f60eafbf009a | 236 | + SPI2_SCK = P2_4, |
gmehmet | 1:f60eafbf009a | 237 | + SPI2_MOSI = P2_5, |
gmehmet | 1:f60eafbf009a | 238 | + SPI2_MISO = P2_6, |
gmehmet | 1:f60eafbf009a | 239 | + SPI2_SS = P2_7, |
gmehmet | 1:f60eafbf009a | 240 | + |
gmehmet | 1:f60eafbf009a | 241 | + // Not connected |
gmehmet | 1:f60eafbf009a | 242 | + NC = NOT_CONNECTED |
gmehmet | 1:f60eafbf009a | 243 | +} PinName; |
gmehmet | 1:f60eafbf009a | 244 | + |
gmehmet | 1:f60eafbf009a | 245 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 246 | + PullUp, |
gmehmet | 1:f60eafbf009a | 247 | + PullDown, |
gmehmet | 1:f60eafbf009a | 248 | + OpenDrain, |
gmehmet | 1:f60eafbf009a | 249 | + PullNone, |
gmehmet | 1:f60eafbf009a | 250 | + PullDefault = PullUp |
gmehmet | 1:f60eafbf009a | 251 | +} PinMode; |
gmehmet | 1:f60eafbf009a | 252 | + |
gmehmet | 1:f60eafbf009a | 253 | +typedef enum { |
gmehmet | 1:f60eafbf009a | 254 | + LED_ON = 0, |
gmehmet | 1:f60eafbf009a | 255 | + LED_OFF = 1 |
gmehmet | 1:f60eafbf009a | 256 | +} LedStates; |
gmehmet | 1:f60eafbf009a | 257 | + |
gmehmet | 1:f60eafbf009a | 258 | +#ifdef __cplusplus |
gmehmet | 1:f60eafbf009a | 259 | +} |
gmehmet | 1:f60eafbf009a | 260 | +#endif |
gmehmet | 1:f60eafbf009a | 261 | + |
gmehmet | 1:f60eafbf009a | 262 | +#endif |
gmehmet | 1:f60eafbf009a | 263 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/low_level_init.c b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/low_level_init.c |
gmehmet | 1:f60eafbf009a | 264 | new file mode 100644 |
gmehmet | 1:f60eafbf009a | 265 | index 000000000..1c56f9891 |
gmehmet | 1:f60eafbf009a | 266 | --- /dev/null |
gmehmet | 1:f60eafbf009a | 267 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/TARGET_MAX32625PICO/low_level_init.c |
gmehmet | 1:f60eafbf009a | 268 | @@ -0,0 +1,56 @@ |
gmehmet | 1:f60eafbf009a | 269 | +/******************************************************************************* |
gmehmet | 1:f60eafbf009a | 270 | + * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved. |
gmehmet | 1:f60eafbf009a | 271 | + * |
gmehmet | 1:f60eafbf009a | 272 | + * Permission is hereby granted, free of charge, to any person obtaining a |
gmehmet | 1:f60eafbf009a | 273 | + * copy of this software and associated documentation files (the "Software"), |
gmehmet | 1:f60eafbf009a | 274 | + * to deal in the Software without restriction, including without limitation |
gmehmet | 1:f60eafbf009a | 275 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
gmehmet | 1:f60eafbf009a | 276 | + * and/or sell copies of the Software, and to permit persons to whom the |
gmehmet | 1:f60eafbf009a | 277 | + * Software is furnished to do so, subject to the following conditions: |
gmehmet | 1:f60eafbf009a | 278 | + * |
gmehmet | 1:f60eafbf009a | 279 | + * The above copyright notice and this permission notice shall be included |
gmehmet | 1:f60eafbf009a | 280 | + * in all copies or substantial portions of the Software. |
gmehmet | 1:f60eafbf009a | 281 | + * |
gmehmet | 1:f60eafbf009a | 282 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
gmehmet | 1:f60eafbf009a | 283 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
gmehmet | 1:f60eafbf009a | 284 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
gmehmet | 1:f60eafbf009a | 285 | + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
gmehmet | 1:f60eafbf009a | 286 | + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
gmehmet | 1:f60eafbf009a | 287 | + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
gmehmet | 1:f60eafbf009a | 288 | + * OTHER DEALINGS IN THE SOFTWARE. |
gmehmet | 1:f60eafbf009a | 289 | + * |
gmehmet | 1:f60eafbf009a | 290 | + * Except as contained in this notice, the name of Maxim Integrated |
gmehmet | 1:f60eafbf009a | 291 | + * Products, Inc. shall not be used except as stated in the Maxim Integrated |
gmehmet | 1:f60eafbf009a | 292 | + * Products, Inc. Branding Policy. |
gmehmet | 1:f60eafbf009a | 293 | + * |
gmehmet | 1:f60eafbf009a | 294 | + * The mere transfer of this software does not imply any licenses |
gmehmet | 1:f60eafbf009a | 295 | + * of trade secrets, proprietary technology, copyrights, patents, |
gmehmet | 1:f60eafbf009a | 296 | + * trademarks, maskwork rights, or any other form of intellectual |
gmehmet | 1:f60eafbf009a | 297 | + * property whatsoever. Maxim Integrated Products, Inc. retains all |
gmehmet | 1:f60eafbf009a | 298 | + * ownership rights. |
gmehmet | 1:f60eafbf009a | 299 | + ******************************************************************************* |
gmehmet | 1:f60eafbf009a | 300 | + */ |
gmehmet | 1:f60eafbf009a | 301 | + |
gmehmet | 1:f60eafbf009a | 302 | +#include "cmsis.h" |
gmehmet | 1:f60eafbf009a | 303 | +#include "ioman_regs.h" |
gmehmet | 1:f60eafbf009a | 304 | +#include "gpio_regs.h" |
gmehmet | 1:f60eafbf009a | 305 | + |
gmehmet | 1:f60eafbf009a | 306 | +//****************************************************************************** |
gmehmet | 1:f60eafbf009a | 307 | +// This function will get called early in system initialization |
gmehmet | 1:f60eafbf009a | 308 | +void low_level_init(void) |
gmehmet | 1:f60eafbf009a | 309 | +{ |
gmehmet | 1:f60eafbf009a | 310 | + /* The MAX32625PICO board utilizes a bootloader that can leave some |
gmehmet | 1:f60eafbf009a | 311 | + * peripherals in a partially configured state. This function resets |
gmehmet | 1:f60eafbf009a | 312 | + * those to allow proper initialization. |
gmehmet | 1:f60eafbf009a | 313 | + */ |
gmehmet | 1:f60eafbf009a | 314 | + MXC_IOMAN->uart0_req = 0x0; // Clear any requests |
gmehmet | 1:f60eafbf009a | 315 | + MXC_IOMAN->uart1_req = 0x0; // Clear any requests |
gmehmet | 1:f60eafbf009a | 316 | + |
gmehmet | 1:f60eafbf009a | 317 | + MXC_GPIO->inten[2] = 0x0; // Clear interrupt enable |
gmehmet | 1:f60eafbf009a | 318 | + MXC_GPIO->int_mode[2] = 0x0; // Clear interrupt mode |
gmehmet | 1:f60eafbf009a | 319 | + MXC_GPIO->in_mode[2] = 0x22222222; // Clear input mode |
gmehmet | 1:f60eafbf009a | 320 | + MXC_GPIO->out_val[2] = 0x0; // Clear output value |
gmehmet | 1:f60eafbf009a | 321 | + MXC_GPIO->out_mode[2] = 0xFFFFFFFF; // Clear output mode |
gmehmet | 1:f60eafbf009a | 322 | + |
gmehmet | 1:f60eafbf009a | 323 | + |
gmehmet | 1:f60eafbf009a | 324 | +} |
gmehmet | 1:f60eafbf009a | 325 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625PICO/MAX32625.sct b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625PICO/MAX32625.sct |
gmehmet | 1:f60eafbf009a | 326 | new file mode 100644 |
gmehmet | 1:f60eafbf009a | 327 | index 000000000..6ea0cb73b |
gmehmet | 1:f60eafbf009a | 328 | --- /dev/null |
gmehmet | 1:f60eafbf009a | 329 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625PICO/MAX32625.sct |
gmehmet | 1:f60eafbf009a | 330 | @@ -0,0 +1,16 @@ |
gmehmet | 1:f60eafbf009a | 331 | +; MAX32625 |
gmehmet | 1:f60eafbf009a | 332 | +; 512KB FLASH (0x70000) @ 0x000010000 |
gmehmet | 1:f60eafbf009a | 333 | +; 160KB RAM (0x24F00) @ 0x20003100 |
gmehmet | 1:f60eafbf009a | 334 | + |
gmehmet | 1:f60eafbf009a | 335 | +LR_IROM1 0x000010000 0x70000 { ; load region size_region |
gmehmet | 1:f60eafbf009a | 336 | + ER_IROM1 0x000010000 0x70000 { ; load address = execution address |
gmehmet | 1:f60eafbf009a | 337 | + *.o (RESET, +First) |
gmehmet | 1:f60eafbf009a | 338 | + *(InRoot$$Sections) |
gmehmet | 1:f60eafbf009a | 339 | + .ANY (+RO) |
gmehmet | 1:f60eafbf009a | 340 | + } |
gmehmet | 1:f60eafbf009a | 341 | + |
gmehmet | 1:f60eafbf009a | 342 | + ; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) |
gmehmet | 1:f60eafbf009a | 343 | + RW_IRAM1 (0x20003100+0x110) (0x24F00-0x110) { ; RW data |
gmehmet | 1:f60eafbf009a | 344 | + .ANY (+RW +ZI) |
gmehmet | 1:f60eafbf009a | 345 | + } |
gmehmet | 1:f60eafbf009a | 346 | +} |
gmehmet | 1:f60eafbf009a | 347 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625PICO/max32625.ld b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625PICO/max32625.ld |
gmehmet | 1:f60eafbf009a | 348 | new file mode 100644 |
gmehmet | 1:f60eafbf009a | 349 | index 000000000..f51f007f1 |
gmehmet | 1:f60eafbf009a | 350 | --- /dev/null |
gmehmet | 1:f60eafbf009a | 351 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625PICO/max32625.ld |
gmehmet | 1:f60eafbf009a | 352 | @@ -0,0 +1,176 @@ |
gmehmet | 1:f60eafbf009a | 353 | +/******************************************************************************* |
gmehmet | 1:f60eafbf009a | 354 | + * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
gmehmet | 1:f60eafbf009a | 355 | + * |
gmehmet | 1:f60eafbf009a | 356 | + * Permission is hereby granted, free of charge, to any person obtaining a |
gmehmet | 1:f60eafbf009a | 357 | + * copy of this software and associated documentation files (the "Software"), |
gmehmet | 1:f60eafbf009a | 358 | + * to deal in the Software without restriction, including without limitation |
gmehmet | 1:f60eafbf009a | 359 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
gmehmet | 1:f60eafbf009a | 360 | + * and/or sell copies of the Software, and to permit persons to whom the |
gmehmet | 1:f60eafbf009a | 361 | + * Software is furnished to do so, subject to the following conditions: |
gmehmet | 1:f60eafbf009a | 362 | + * |
gmehmet | 1:f60eafbf009a | 363 | + * The above copyright notice and this permission notice shall be included |
gmehmet | 1:f60eafbf009a | 364 | + * in all copies or substantial portions of the Software. |
gmehmet | 1:f60eafbf009a | 365 | + * |
gmehmet | 1:f60eafbf009a | 366 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
gmehmet | 1:f60eafbf009a | 367 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
gmehmet | 1:f60eafbf009a | 368 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
gmehmet | 1:f60eafbf009a | 369 | + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
gmehmet | 1:f60eafbf009a | 370 | + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
gmehmet | 1:f60eafbf009a | 371 | + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
gmehmet | 1:f60eafbf009a | 372 | + * OTHER DEALINGS IN THE SOFTWARE. |
gmehmet | 1:f60eafbf009a | 373 | + * |
gmehmet | 1:f60eafbf009a | 374 | + * Except as contained in this notice, the name of Maxim Integrated |
gmehmet | 1:f60eafbf009a | 375 | + * Products, Inc. shall not be used except as stated in the Maxim Integrated |
gmehmet | 1:f60eafbf009a | 376 | + * Products, Inc. Branding Policy. |
gmehmet | 1:f60eafbf009a | 377 | + * |
gmehmet | 1:f60eafbf009a | 378 | + * The mere transfer of this software does not imply any licenses |
gmehmet | 1:f60eafbf009a | 379 | + * of trade secrets, proprietary technology, copyrights, patents, |
gmehmet | 1:f60eafbf009a | 380 | + * trademarks, maskwork rights, or any other form of intellectual |
gmehmet | 1:f60eafbf009a | 381 | + * property whatsoever. Maxim Integrated Products, Inc. retains all |
gmehmet | 1:f60eafbf009a | 382 | + * ownership rights. |
gmehmet | 1:f60eafbf009a | 383 | + ******************************************************************************* |
gmehmet | 1:f60eafbf009a | 384 | + */ |
gmehmet | 1:f60eafbf009a | 385 | + |
gmehmet | 1:f60eafbf009a | 386 | +MEMORY |
gmehmet | 1:f60eafbf009a | 387 | +{ |
gmehmet | 1:f60eafbf009a | 388 | + FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 0x00070000 |
gmehmet | 1:f60eafbf009a | 389 | + RAM (rwx) : ORIGIN = 0x20003100, LENGTH = 0x00024F00 |
gmehmet | 1:f60eafbf009a | 390 | +} |
gmehmet | 1:f60eafbf009a | 391 | + |
gmehmet | 1:f60eafbf009a | 392 | +/* Linker script to place sections and symbol values. Should be used together |
gmehmet | 1:f60eafbf009a | 393 | + * with other linker script that defines memory regions FLASH and RAM. |
gmehmet | 1:f60eafbf009a | 394 | + * It references following symbols, which must be defined in code: |
gmehmet | 1:f60eafbf009a | 395 | + * Reset_Handler : Entry of reset handler |
gmehmet | 1:f60eafbf009a | 396 | + * |
gmehmet | 1:f60eafbf009a | 397 | + * It defines following symbols, which code can use without definition: |
gmehmet | 1:f60eafbf009a | 398 | + * __exidx_start |
gmehmet | 1:f60eafbf009a | 399 | + * __exidx_end |
gmehmet | 1:f60eafbf009a | 400 | + * __etext |
gmehmet | 1:f60eafbf009a | 401 | + * __data_start__ |
gmehmet | 1:f60eafbf009a | 402 | + * __preinit_array_start |
gmehmet | 1:f60eafbf009a | 403 | + * __preinit_array_end |
gmehmet | 1:f60eafbf009a | 404 | + * __init_array_start |
gmehmet | 1:f60eafbf009a | 405 | + * __init_array_end |
gmehmet | 1:f60eafbf009a | 406 | + * __fini_array_start |
gmehmet | 1:f60eafbf009a | 407 | + * __fini_array_end |
gmehmet | 1:f60eafbf009a | 408 | + * __data_end__ |
gmehmet | 1:f60eafbf009a | 409 | + * __bss_start__ |
gmehmet | 1:f60eafbf009a | 410 | + * __bss_end__ |
gmehmet | 1:f60eafbf009a | 411 | + * __end__ |
gmehmet | 1:f60eafbf009a | 412 | + * end |
gmehmet | 1:f60eafbf009a | 413 | + * __HeapLimit |
gmehmet | 1:f60eafbf009a | 414 | + * __StackLimit |
gmehmet | 1:f60eafbf009a | 415 | + * __StackTop |
gmehmet | 1:f60eafbf009a | 416 | + * __stack |
gmehmet | 1:f60eafbf009a | 417 | + */ |
gmehmet | 1:f60eafbf009a | 418 | +ENTRY(Reset_Handler) |
gmehmet | 1:f60eafbf009a | 419 | + |
gmehmet | 1:f60eafbf009a | 420 | +SECTIONS |
gmehmet | 1:f60eafbf009a | 421 | +{ |
gmehmet | 1:f60eafbf009a | 422 | + .text : |
gmehmet | 1:f60eafbf009a | 423 | + { |
gmehmet | 1:f60eafbf009a | 424 | + KEEP(*(.isr_vector)) |
gmehmet | 1:f60eafbf009a | 425 | + *(.text*) |
gmehmet | 1:f60eafbf009a | 426 | + |
gmehmet | 1:f60eafbf009a | 427 | + KEEP(*(.init)) |
gmehmet | 1:f60eafbf009a | 428 | + KEEP(*(.fini)) |
gmehmet | 1:f60eafbf009a | 429 | + |
gmehmet | 1:f60eafbf009a | 430 | + /* .ctors */ |
gmehmet | 1:f60eafbf009a | 431 | + *crtbegin.o(.ctors) |
gmehmet | 1:f60eafbf009a | 432 | + *crtbegin?.o(.ctors) |
gmehmet | 1:f60eafbf009a | 433 | + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
gmehmet | 1:f60eafbf009a | 434 | + *(SORT(.ctors.*)) |
gmehmet | 1:f60eafbf009a | 435 | + *(.ctors) |
gmehmet | 1:f60eafbf009a | 436 | + |
gmehmet | 1:f60eafbf009a | 437 | + /* .dtors */ |
gmehmet | 1:f60eafbf009a | 438 | + *crtbegin.o(.dtors) |
gmehmet | 1:f60eafbf009a | 439 | + *crtbegin?.o(.dtors) |
gmehmet | 1:f60eafbf009a | 440 | + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
gmehmet | 1:f60eafbf009a | 441 | + *(SORT(.dtors.*)) |
gmehmet | 1:f60eafbf009a | 442 | + *(.dtors) |
gmehmet | 1:f60eafbf009a | 443 | + |
gmehmet | 1:f60eafbf009a | 444 | + *(.rodata*) |
gmehmet | 1:f60eafbf009a | 445 | + |
gmehmet | 1:f60eafbf009a | 446 | + KEEP(*(.eh_frame*)) |
gmehmet | 1:f60eafbf009a | 447 | + } > FLASH |
gmehmet | 1:f60eafbf009a | 448 | + |
gmehmet | 1:f60eafbf009a | 449 | + .ARM.extab : |
gmehmet | 1:f60eafbf009a | 450 | + { |
gmehmet | 1:f60eafbf009a | 451 | + *(.ARM.extab* .gnu.linkonce.armextab.*) |
gmehmet | 1:f60eafbf009a | 452 | + } > FLASH |
gmehmet | 1:f60eafbf009a | 453 | + |
gmehmet | 1:f60eafbf009a | 454 | + __exidx_start = .; |
gmehmet | 1:f60eafbf009a | 455 | + .ARM.exidx : |
gmehmet | 1:f60eafbf009a | 456 | + { |
gmehmet | 1:f60eafbf009a | 457 | + *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
gmehmet | 1:f60eafbf009a | 458 | + } > FLASH |
gmehmet | 1:f60eafbf009a | 459 | + __exidx_end = .; |
gmehmet | 1:f60eafbf009a | 460 | + |
gmehmet | 1:f60eafbf009a | 461 | + __etext = .; |
gmehmet | 1:f60eafbf009a | 462 | + |
gmehmet | 1:f60eafbf009a | 463 | + .data : AT (__etext) |
gmehmet | 1:f60eafbf009a | 464 | + { |
gmehmet | 1:f60eafbf009a | 465 | + __data_start__ = .; |
gmehmet | 1:f60eafbf009a | 466 | + *(vtable) |
gmehmet | 1:f60eafbf009a | 467 | + *(.data*) |
gmehmet | 1:f60eafbf009a | 468 | + |
gmehmet | 1:f60eafbf009a | 469 | + . = ALIGN(4); |
gmehmet | 1:f60eafbf009a | 470 | + /* preinit data */ |
gmehmet | 1:f60eafbf009a | 471 | + PROVIDE_HIDDEN (__preinit_array_start = .); |
gmehmet | 1:f60eafbf009a | 472 | + KEEP(*(.preinit_array)) |
gmehmet | 1:f60eafbf009a | 473 | + PROVIDE_HIDDEN (__preinit_array_end = .); |
gmehmet | 1:f60eafbf009a | 474 | + |
gmehmet | 1:f60eafbf009a | 475 | + . = ALIGN(4); |
gmehmet | 1:f60eafbf009a | 476 | + /* init data */ |
gmehmet | 1:f60eafbf009a | 477 | + PROVIDE_HIDDEN (__init_array_start = .); |
gmehmet | 1:f60eafbf009a | 478 | + KEEP(*(SORT(.init_array.*))) |
gmehmet | 1:f60eafbf009a | 479 | + KEEP(*(.init_array)) |
gmehmet | 1:f60eafbf009a | 480 | + PROVIDE_HIDDEN (__init_array_end = .); |
gmehmet | 1:f60eafbf009a | 481 | + |
gmehmet | 1:f60eafbf009a | 482 | + |
gmehmet | 1:f60eafbf009a | 483 | + . = ALIGN(4); |
gmehmet | 1:f60eafbf009a | 484 | + /* finit data */ |
gmehmet | 1:f60eafbf009a | 485 | + PROVIDE_HIDDEN (__fini_array_start = .); |
gmehmet | 1:f60eafbf009a | 486 | + KEEP(*(SORT(.fini_array.*))) |
gmehmet | 1:f60eafbf009a | 487 | + KEEP(*(.fini_array)) |
gmehmet | 1:f60eafbf009a | 488 | + PROVIDE_HIDDEN (__fini_array_end = .); |
gmehmet | 1:f60eafbf009a | 489 | + |
gmehmet | 1:f60eafbf009a | 490 | + . = ALIGN(4); |
gmehmet | 1:f60eafbf009a | 491 | + /* All data end */ |
gmehmet | 1:f60eafbf009a | 492 | + __data_end__ = .; |
gmehmet | 1:f60eafbf009a | 493 | + |
gmehmet | 1:f60eafbf009a | 494 | + } > RAM |
gmehmet | 1:f60eafbf009a | 495 | + |
gmehmet | 1:f60eafbf009a | 496 | + .bss : |
gmehmet | 1:f60eafbf009a | 497 | + { |
gmehmet | 1:f60eafbf009a | 498 | + __bss_start__ = .; |
gmehmet | 1:f60eafbf009a | 499 | + *(.bss*) |
gmehmet | 1:f60eafbf009a | 500 | + *(COMMON) |
gmehmet | 1:f60eafbf009a | 501 | + __bss_end__ = .; |
gmehmet | 1:f60eafbf009a | 502 | + } > RAM |
gmehmet | 1:f60eafbf009a | 503 | + |
gmehmet | 1:f60eafbf009a | 504 | + .heap : |
gmehmet | 1:f60eafbf009a | 505 | + { |
gmehmet | 1:f60eafbf009a | 506 | + __end__ = .; |
gmehmet | 1:f60eafbf009a | 507 | + end = __end__; |
gmehmet | 1:f60eafbf009a | 508 | + *(.heap*) |
gmehmet | 1:f60eafbf009a | 509 | + __HeapLimit = .; |
gmehmet | 1:f60eafbf009a | 510 | + } > RAM |
gmehmet | 1:f60eafbf009a | 511 | + |
gmehmet | 1:f60eafbf009a | 512 | + /* .stack_dummy section doesn't contains any symbols. It is only |
gmehmet | 1:f60eafbf009a | 513 | + * used for linker to calculate size of stack sections, and assign |
gmehmet | 1:f60eafbf009a | 514 | + * values to stack symbols later */ |
gmehmet | 1:f60eafbf009a | 515 | + .stack_dummy : |
gmehmet | 1:f60eafbf009a | 516 | + { |
gmehmet | 1:f60eafbf009a | 517 | + *(.stack) |
gmehmet | 1:f60eafbf009a | 518 | + } > RAM |
gmehmet | 1:f60eafbf009a | 519 | + |
gmehmet | 1:f60eafbf009a | 520 | + /* Set stack top to end of RAM, and stack limit move down by |
gmehmet | 1:f60eafbf009a | 521 | + * size of stack_dummy section */ |
gmehmet | 1:f60eafbf009a | 522 | + __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
gmehmet | 1:f60eafbf009a | 523 | + __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
gmehmet | 1:f60eafbf009a | 524 | + PROVIDE(__stack = __StackTop); |
gmehmet | 1:f60eafbf009a | 525 | + |
gmehmet | 1:f60eafbf009a | 526 | + /* Check if data + heap + stack exceeds RAM limit */ |
gmehmet | 1:f60eafbf009a | 527 | + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
gmehmet | 1:f60eafbf009a | 528 | +} |
gmehmet | 1:f60eafbf009a | 529 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625PICO/MAX32625.icf b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625PICO/MAX32625.icf |
gmehmet | 1:f60eafbf009a | 530 | new file mode 100644 |
gmehmet | 1:f60eafbf009a | 531 | index 000000000..bba1c8067 |
gmehmet | 1:f60eafbf009a | 532 | --- /dev/null |
gmehmet | 1:f60eafbf009a | 533 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625PICO/MAX32625.icf |
gmehmet | 1:f60eafbf009a | 534 | @@ -0,0 +1,29 @@ |
gmehmet | 1:f60eafbf009a | 535 | +/* [ROM] */ |
gmehmet | 1:f60eafbf009a | 536 | +define symbol __intvec_start__ = 0x00010000; |
gmehmet | 1:f60eafbf009a | 537 | +define symbol __region_ROM_start__ = 0x00010000; |
gmehmet | 1:f60eafbf009a | 538 | +define symbol __region_ROM_end__ = 0x0007FFFF; |
gmehmet | 1:f60eafbf009a | 539 | + |
gmehmet | 1:f60eafbf009a | 540 | +/* [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) bytes */ |
gmehmet | 1:f60eafbf009a | 541 | +define symbol __NVIC_start__ = 0x00010000; |
gmehmet | 1:f60eafbf009a | 542 | +define symbol __NVIC_end__ = 0x00010110; /* to be aligned on 8 bytes */ |
gmehmet | 1:f60eafbf009a | 543 | +define symbol __region_RAM_start__ = 0x20003100; |
gmehmet | 1:f60eafbf009a | 544 | +define symbol __region_RAM_end__ = 0x20027FFF; |
gmehmet | 1:f60eafbf009a | 545 | + |
gmehmet | 1:f60eafbf009a | 546 | +/* Memory regions */ |
gmehmet | 1:f60eafbf009a | 547 | +define memory mem with size = 4G; |
gmehmet | 1:f60eafbf009a | 548 | +define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__]; |
gmehmet | 1:f60eafbf009a | 549 | +define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__]; |
gmehmet | 1:f60eafbf009a | 550 | + |
gmehmet | 1:f60eafbf009a | 551 | +/* Stack and Heap */ |
gmehmet | 1:f60eafbf009a | 552 | +define symbol __size_cstack__ = 0x5000; |
gmehmet | 1:f60eafbf009a | 553 | +define symbol __size_heap__ = 0xA000; |
gmehmet | 1:f60eafbf009a | 554 | +define block CSTACK with alignment = 8, size = __size_cstack__ { }; |
gmehmet | 1:f60eafbf009a | 555 | +define block HEAP with alignment = 8, size = __size_heap__ { }; |
gmehmet | 1:f60eafbf009a | 556 | + |
gmehmet | 1:f60eafbf009a | 557 | +initialize by copy { readwrite }; |
gmehmet | 1:f60eafbf009a | 558 | +do not initialize { section .noinit }; |
gmehmet | 1:f60eafbf009a | 559 | + |
gmehmet | 1:f60eafbf009a | 560 | +place at address mem:__intvec_start__ { readonly section .intvec }; |
gmehmet | 1:f60eafbf009a | 561 | +place in ROM_region { readonly }; |
gmehmet | 1:f60eafbf009a | 562 | +place in RAM_region { readwrite, |
gmehmet | 1:f60eafbf009a | 563 | + block CSTACK, block HEAP }; |
gmehmet | 1:f60eafbf009a | 564 | diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/device/system_max32625.c b/targets/TARGET_Maxim/TARGET_MAX32625/device/system_max32625.c |
gmehmet | 1:f60eafbf009a | 565 | index 4f77b2116..bba36bb5c 100644 |
gmehmet | 1:f60eafbf009a | 566 | --- a/targets/TARGET_Maxim/TARGET_MAX32625/device/system_max32625.c |
gmehmet | 1:f60eafbf009a | 567 | +++ b/targets/TARGET_Maxim/TARGET_MAX32625/device/system_max32625.c |
gmehmet | 1:f60eafbf009a | 568 | @@ -171,6 +171,10 @@ __weak int PreInit(void) |
gmehmet | 1:f60eafbf009a | 569 | return 0; |
gmehmet | 1:f60eafbf009a | 570 | } |
gmehmet | 1:f60eafbf009a | 571 | |
gmehmet | 1:f60eafbf009a | 572 | +/* Override this function for early platform initialization |
gmehmet | 1:f60eafbf009a | 573 | +*/ |
gmehmet | 1:f60eafbf009a | 574 | +__weak void low_level_init(void) {} |
gmehmet | 1:f60eafbf009a | 575 | + |
gmehmet | 1:f60eafbf009a | 576 | /* This function is called just before control is transferred to main(). |
gmehmet | 1:f60eafbf009a | 577 | */ |
gmehmet | 1:f60eafbf009a | 578 | void SystemInit(void) |
gmehmet | 1:f60eafbf009a | 579 | @@ -258,6 +262,9 @@ void SystemInit(void) |
gmehmet | 1:f60eafbf009a | 580 | __ISB(); |
gmehmet | 1:f60eafbf009a | 581 | #endif |
gmehmet | 1:f60eafbf009a | 582 | |
gmehmet | 1:f60eafbf009a | 583 | + /* Early platform initialization */ |
gmehmet | 1:f60eafbf009a | 584 | + low_level_init(); |
gmehmet | 1:f60eafbf009a | 585 | + |
gmehmet | 1:f60eafbf009a | 586 | /* Perform an initial trim of the internal ring oscillator */ |
gmehmet | 1:f60eafbf009a | 587 | CLKMAN_TrimRO(); |
gmehmet | 1:f60eafbf009a | 588 | } |
gmehmet | 1:f60eafbf009a | 589 | diff --git a/targets/targets.json b/targets/targets.json |
gmehmet | 1:f60eafbf009a | 590 | index ee38b950b..12d5cf61b 100644 |
gmehmet | 1:f60eafbf009a | 591 | --- a/targets/targets.json |
gmehmet | 1:f60eafbf009a | 592 | +++ b/targets/targets.json |
gmehmet | 1:f60eafbf009a | 593 | @@ -1904,6 +1904,15 @@ |
gmehmet | 1:f60eafbf009a | 594 | "device_has": ["ANALOGIN", "ERROR_RED", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES"], |
gmehmet | 1:f60eafbf009a | 595 | "release_versions": ["2", "5"] |
gmehmet | 1:f60eafbf009a | 596 | }, |
gmehmet | 1:f60eafbf009a | 597 | + "MAX32625PICO": { |
gmehmet | 1:f60eafbf009a | 598 | + "inherits": ["Target"], |
gmehmet | 1:f60eafbf009a | 599 | + "core": "Cortex-M4F", |
gmehmet | 1:f60eafbf009a | 600 | + "macros": ["__SYSTEM_HFX=96000000","TARGET=MAX32625","TARGET_REV=0x4132"], |
gmehmet | 1:f60eafbf009a | 601 | + "extra_labels": ["Maxim", "MAX32625"], |
gmehmet | 1:f60eafbf009a | 602 | + "supported_toolchains": ["GCC_ARM", "IAR", "ARM"], |
gmehmet | 1:f60eafbf009a | 603 | + "device_has": ["ANALOGIN", "ERROR_RED", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES"], |
gmehmet | 1:f60eafbf009a | 604 | + "release_versions": ["2", "5"] |
gmehmet | 1:f60eafbf009a | 605 | + }, |
gmehmet | 1:f60eafbf009a | 606 | "MAX32630FTHR": { |
gmehmet | 1:f60eafbf009a | 607 | "inherits": ["Target"], |
gmehmet | 1:f60eafbf009a | 608 | "core": "Cortex-M4F", |
gmehmet | 1:f60eafbf009a | 609 | -- |
gmehmet | 1:f60eafbf009a | 610 | 2.11.1.windows.1 |
gmehmet | 1:f60eafbf009a | 611 |