mirror of https://github.com/ARMmbed/mbed-os.git
Bugfix for EFM32PG12 and EFR32MG12
* Off by one error in the linker scripts reserved one word too little for the vector table * Re-apply uvisor changes to emlib. To allow uvisor to run, we should make accesses to the romtable through uvisor's secure read gateway * Copypasta in target name (EFM32PG12, not EFR32PG12) * Copypasta in the pin definitions (thanks @akselsm) * Forgot to update PortName for extra ports on MG/PG12pull/4025/head
parent
37d47a601c
commit
30333f4579
|
@ -8,7 +8,7 @@ LR_IROM1 0x00000000 0x00100000 { ; load region size_region
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
RW_IRAM1 0x20000108 0x0003FEF8 { ; RW data
|
RW_IRAM1 0x2000010C 0x0003FEF4 { ; RW data
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -17,8 +17,8 @@ MEMORY
|
||||||
|
|
||||||
/* MBED: mbed needs to be able to dynamically set the interrupt vector table.
|
/* MBED: mbed needs to be able to dynamically set the interrupt vector table.
|
||||||
* We make room for the table at the very beginning of RAM, i.e. at
|
* We make room for the table at the very beginning of RAM, i.e. at
|
||||||
* 0x20000000. We need (16+50 * sizeof(uint32_t) = 264 bytes for EFM32PG */
|
* 0x20000000. We need (16+51 * sizeof(uint32_t) = 268 bytes for EFM32PG */
|
||||||
__vector_size = 0x108;
|
__vector_size = 0x10C;
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
* with other linker script that defines memory regions FLASH and RAM.
|
* with other linker script that defines memory regions FLASH and RAM.
|
|
@ -10,8 +10,8 @@ define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
||||||
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
||||||
define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x00100000-1);
|
define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x00100000-1);
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
define symbol __NVIC_start__ = 0x20000000;
|
||||||
define symbol __NVIC_end__ = 0x20000107;
|
define symbol __NVIC_end__ = 0x2000010B;
|
||||||
define symbol __ICFEDIT_region_RAM_start__ = 0x20000108;
|
define symbol __ICFEDIT_region_RAM_start__ = 0x2000010C;
|
||||||
define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x00040000-1);
|
define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x00040000-1);
|
||||||
|
|
||||||
/*-Sizes-*/
|
/*-Sizes-*/
|
|
@ -8,7 +8,7 @@ LR_IROM1 0x00000000 0x00100000 { ; load region size_region
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
}
|
}
|
||||||
RW_IRAM1 0x20000108 0x0003FEF8 { ; RW data
|
RW_IRAM1 0x2000010C 0x0003FEF4 { ; RW data
|
||||||
.ANY (+RW +ZI)
|
.ANY (+RW +ZI)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,8 @@ MEMORY
|
||||||
|
|
||||||
/* MBED: mbed needs to be able to dynamically set the interrupt vector table.
|
/* MBED: mbed needs to be able to dynamically set the interrupt vector table.
|
||||||
* We make room for the table at the very beginning of RAM, i.e. at
|
* We make room for the table at the very beginning of RAM, i.e. at
|
||||||
* 0x20000000. We need (16+50 * sizeof(uint32_t) = 264 bytes for EFM32PG */
|
* 0x20000000. We need (16+51 * sizeof(uint32_t) = 268 bytes for EFM32PG */
|
||||||
__vector_size = 0x108;
|
__vector_size = 0x10C;
|
||||||
|
|
||||||
/* Linker script to place sections and symbol values. Should be used together
|
/* Linker script to place sections and symbol values. Should be used together
|
||||||
* with other linker script that defines memory regions FLASH and RAM.
|
* with other linker script that defines memory regions FLASH and RAM.
|
||||||
|
|
|
@ -7,8 +7,8 @@ define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
||||||
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
||||||
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
|
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
|
||||||
define symbol __NVIC_start__ = 0x20000000;
|
define symbol __NVIC_start__ = 0x20000000;
|
||||||
define symbol __NVIC_end__ = 0x20000107;
|
define symbol __NVIC_end__ = 0x2000010B;
|
||||||
define symbol __ICFEDIT_region_RAM_start__ = 0x20000108;
|
define symbol __ICFEDIT_region_RAM_start__ = 0x2000010C;
|
||||||
define symbol __ICFEDIT_region_RAM_end__ = 0x2003FFFF;
|
define symbol __ICFEDIT_region_RAM_end__ = 0x2003FFFF;
|
||||||
/*-Sizes-*/
|
/*-Sizes-*/
|
||||||
/*Heap 1/4 of ram and stack 1/8*/
|
/*Heap 1/4 of ram and stack 1/8*/
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, \
|
PF0 = 5 << 4, PF1, PF2, PF3, PF4, PF5, PF6, PF7, PF8, PF9, PF10, PF11, PF12, PF13, PF14, PF15, \
|
||||||
PG0 = 6 << 4, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, \
|
PG0 = 6 << 4, PG1, PG2, PG3, PG4, PG5, PG6, PG7, PG8, PG9, PG10, PG11, PG12, PG13, PG14, PG15, \
|
||||||
PH0 = 7 << 4, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, \
|
PH0 = 7 << 4, PH1, PH2, PH3, PH4, PH5, PH6, PH7, PH8, PH9, PH10, PH11, PH12, PH13, PH14, PH15, \
|
||||||
PI0 = 7 << 4, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, \
|
PI0 = 8 << 4, PI1, PI2, PI3, PI4, PI5, PI6, PI7, PI8, PI9, PI10, PI11, PI12, PI13, PI14, PI15, \
|
||||||
PJ0 = 7 << 4, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, \
|
PJ0 = 9 << 4, PJ1, PJ2, PJ3, PJ4, PJ5, PJ6, PJ7, PJ8, PJ9, PJ10, PJ11, PJ12, PJ13, PJ14, PJ15, \
|
||||||
PK0 = 7 << 4, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, PK15, \
|
PK0 = 10 << 4, PK1, PK2, PK3, PK4, PK5, PK6, PK7, PK8, PK9, PK10, PK11, PK12, PK13, PK14, PK15, \
|
||||||
NC = (int) 0xFFFFFFFF
|
NC = (int) 0xFFFFFFFF
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -46,13 +46,22 @@ typedef enum {
|
||||||
PortE = gpioPortE, /**< Port E */
|
PortE = gpioPortE, /**< Port E */
|
||||||
#endif
|
#endif
|
||||||
#if ( _GPIO_PORT_F_PIN_COUNT > 0 )
|
#if ( _GPIO_PORT_F_PIN_COUNT > 0 )
|
||||||
PortF = gpioPortF /**< Port F */
|
PortF = gpioPortF, /**< Port F */
|
||||||
#endif
|
#endif
|
||||||
#if defined( _GPIO_PORT_G_PIN_COUNT ) && ( _GPIO_PORT_G_PIN_COUNT > 0 )
|
#if defined( _GPIO_PORT_G_PIN_COUNT ) && ( _GPIO_PORT_G_PIN_COUNT > 0 )
|
||||||
PortG = gpioPortG /**< Port F */
|
PortG = gpioPortG, /**< Port G */
|
||||||
#endif
|
#endif
|
||||||
#if defined( _GPIO_PORT_H_PIN_COUNT ) && ( _GPIO_PORT_H_PIN_COUNT > 0 )
|
#if defined( _GPIO_PORT_H_PIN_COUNT ) && ( _GPIO_PORT_H_PIN_COUNT > 0 )
|
||||||
PortH = gpioPortH /**< Port F */
|
PortH = gpioPortH, /**< Port H */
|
||||||
|
#endif
|
||||||
|
#if defined( _GPIO_PORT_I_PIN_COUNT ) && ( _GPIO_PORT_I_PIN_COUNT > 0 )
|
||||||
|
PortI = gpioPortI, /**< Port I */
|
||||||
|
#endif
|
||||||
|
#if defined( _GPIO_PORT_J_PIN_COUNT ) && ( _GPIO_PORT_J_PIN_COUNT > 0 )
|
||||||
|
PortJ = gpioPortJ, /**< Port J */
|
||||||
|
#endif
|
||||||
|
#if defined( _GPIO_PORT_K_PIN_COUNT ) && ( _GPIO_PORT_K_PIN_COUNT > 0 )
|
||||||
|
PortK = gpioPortK, /**< Port K */
|
||||||
#endif
|
#endif
|
||||||
} PortName;
|
} PortName;
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "em_system.h"
|
#include "em_system.h"
|
||||||
#include "em_assert.h"
|
#include "em_assert.h"
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include "core_cmSecureAccess.h"
|
||||||
|
|
||||||
/***************************************************************************//**
|
/***************************************************************************//**
|
||||||
* @addtogroup emlib
|
* @addtogroup emlib
|
||||||
|
@ -61,19 +62,24 @@ void SYSTEM_ChipRevisionGet(SYSTEM_ChipRevision_TypeDef *rev)
|
||||||
|
|
||||||
EFM_ASSERT(rev);
|
EFM_ASSERT(rev);
|
||||||
|
|
||||||
|
uint32_t pid0 = SECURE_READ(&(ROMTABLE->PID0));
|
||||||
|
uint32_t pid1 = SECURE_READ(&(ROMTABLE->PID1));
|
||||||
|
uint32_t pid2 = SECURE_READ(&(ROMTABLE->PID2));
|
||||||
|
uint32_t pid3 = SECURE_READ(&(ROMTABLE->PID3));
|
||||||
|
|
||||||
/* CHIP FAMILY bit [5:2] */
|
/* CHIP FAMILY bit [5:2] */
|
||||||
tmp = (((ROMTABLE->PID1 & _ROMTABLE_PID1_FAMILYMSB_MASK) >> _ROMTABLE_PID1_FAMILYMSB_SHIFT) << 2);
|
tmp = (((pid1 & _ROMTABLE_PID1_FAMILYMSB_MASK) >> _ROMTABLE_PID1_FAMILYMSB_SHIFT) << 2);
|
||||||
/* CHIP FAMILY bit [1:0] */
|
/* CHIP FAMILY bit [1:0] */
|
||||||
tmp |= ((ROMTABLE->PID0 & _ROMTABLE_PID0_FAMILYLSB_MASK) >> _ROMTABLE_PID0_FAMILYLSB_SHIFT);
|
tmp |= ((pid0 & _ROMTABLE_PID0_FAMILYLSB_MASK) >> _ROMTABLE_PID0_FAMILYLSB_SHIFT);
|
||||||
rev->family = tmp;
|
rev->family = tmp;
|
||||||
|
|
||||||
/* CHIP MAJOR bit [3:0] */
|
/* CHIP MAJOR bit [3:0] */
|
||||||
rev->major = (ROMTABLE->PID0 & _ROMTABLE_PID0_REVMAJOR_MASK) >> _ROMTABLE_PID0_REVMAJOR_SHIFT;
|
rev->major = (pid0 & _ROMTABLE_PID0_REVMAJOR_MASK) >> _ROMTABLE_PID0_REVMAJOR_SHIFT;
|
||||||
|
|
||||||
/* CHIP MINOR bit [7:4] */
|
/* CHIP MINOR bit [7:4] */
|
||||||
tmp = (((ROMTABLE->PID2 & _ROMTABLE_PID2_REVMINORMSB_MASK) >> _ROMTABLE_PID2_REVMINORMSB_SHIFT) << 4);
|
tmp = (((pid2 & _ROMTABLE_PID2_REVMINORMSB_MASK) >> _ROMTABLE_PID2_REVMINORMSB_SHIFT) << 4);
|
||||||
/* CHIP MINOR bit [3:0] */
|
/* CHIP MINOR bit [3:0] */
|
||||||
tmp |= ((ROMTABLE->PID3 & _ROMTABLE_PID3_REVMINORLSB_MASK) >> _ROMTABLE_PID3_REVMINORLSB_SHIFT);
|
tmp |= ((pid3 & _ROMTABLE_PID3_REVMINORLSB_MASK) >> _ROMTABLE_PID3_REVMINORLSB_SHIFT);
|
||||||
rev->minor = tmp;
|
rev->minor = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2336,18 +2336,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"EFM32PG12B500F1024": {
|
"EFM32PG12B500F1024GL125": {
|
||||||
"inherits": ["EFM32"],
|
"inherits": ["EFM32"],
|
||||||
"extra_labels_add": ["EFM32PG12", "1024K"],
|
"extra_labels_add": ["EFM32PG12", "1024K"],
|
||||||
"core": "Cortex-M4F",
|
"core": "Cortex-M4F",
|
||||||
"macros": ["EFM32PG12B500F1024", "TRANSACTION_QUEUE_SIZE_SPI=4"],
|
"macros": ["EFM32PG12B500F1024GL125", "TRANSACTION_QUEUE_SIZE_SPI=4"],
|
||||||
"supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"],
|
"supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"],
|
||||||
"release_versions": ["2", "5"],
|
"release_versions": ["2", "5"],
|
||||||
"device_name": "EFM32PG12B500F1024",
|
"device_name": "EFM32PG12B500F1024GL125",
|
||||||
"public": false
|
"public": false
|
||||||
},
|
},
|
||||||
"EFM32PG12_STK3402": {
|
"EFM32PG12_STK3402": {
|
||||||
"inherits": ["EFM32PG12B500F1024"],
|
"inherits": ["EFM32PG12B500F1024GL125"],
|
||||||
"device_has": ["AES", "SHA", "ECC", "ANALOGIN", "ERROR_PATTERN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
|
"device_has": ["AES", "SHA", "ECC", "ANALOGIN", "ERROR_PATTERN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
|
||||||
"forced_reset_timeout": 2,
|
"forced_reset_timeout": 2,
|
||||||
"config": {
|
"config": {
|
||||||
|
|
Loading…
Reference in New Issue