Skip to content

Commit bb3fdac

Browse files
authored
Merge pull request #10449 from fredlee12001/UNO_91H_PDMC
Configure UNO_91H to support PDMC compile
2 parents 87711a9 + 749302f commit bb3fdac

File tree

6 files changed

+49
-3
lines changed

6 files changed

+49
-3
lines changed

targets/TARGET_RDA/TARGET_UNO_91H/device/TOOLCHAIN_ARM_STD/TARGET_UNO_91H/RDA5981C.sct

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@
2121
#if defined(RDA_ICACHE_DISABLE)
2222
#define RDA_CODE_BASE (RDA_FLASH_BASE + RDA_PADDR_OFST)
2323
#else /* RDA_ICACHE_DISABLE */
24+
25+
#if !defined(MBED_APP_START) /* MBED_APP_START */
2426
#define RDA_CODE_BASE (RDA_ICACHE_BASE + RDA_PADDR_OFST)
27+
#else /* MBED_APP_START */
28+
#define RDA_CODE_BASE (MBED_APP_START)
29+
#endif /* MBED_APP_START */
30+
2531
#endif /* RDA_ICACHE_DISABLE */
26-
#define RDA_CODE_SIZE (0x001F4000)
32+
33+
#if !defined(MBED_APP_SIZE)
34+
#define MBED_APP_SIZE (0x1F4000)
35+
#endif
36+
#define RDA_CODE_SIZE (MBED_APP_SIZE)
2737
#define RDA_AHB1_BASE (0x40100000)
2838
#define RDA_MEMC_BASE (RDA_AHB1_BASE + 0x00000)
2939

targets/TARGET_RDA/TARGET_UNO_91H/device/TOOLCHAIN_GCC_ARM/TARGET_UNO_91H/RDA5981C.ld

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66

77
STACK_SIZE = MBED_BOOT_STACK_SIZE;
88

9+
#if !defined(MBED_APP_START)
10+
#define MBED_APP_START 0x18001000
11+
#endif
12+
13+
#if !defined(MBED_APP_SIZE)
14+
#define MBED_APP_SIZE 2000K
15+
#endif
16+
917
/* Linker script to configure memory regions. */
1018
MEMORY
1119
{
1220
/* If ICache is enable, use virtual flash base address */
1321
/* Use partition index: 0 */
14-
FLASH (rx) : ORIGIN = 0x18001000, LENGTH = 2000K
22+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
1523
/* Use partition index: 1 */
1624
/* FLASH (rx) : ORIGIN = 0x181F5000, LENGTH = 2000K */
1725

targets/TARGET_RDA/TARGET_UNO_91H/device/TOOLCHAIN_IAR/TARGET_UNO_91H/RDA5981C.icf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ if (0 == RDA_PARTITION_INDEX) {
1717
if (1 == RDA_ICACHE_DISABLE) {
1818
define symbol RDA_CODE_BASE = RDA_FLASH_BASE + RDA_PADDR_OFST;
1919
} else {
20+
/* MBED_APP_START */
21+
if (!isdefinedsymbol(MBED_APP_START)) {
2022
define symbol RDA_CODE_BASE = RDA_ICACHE_BASE + RDA_PADDR_OFST;
23+
} else {
24+
define symbol RDA_CODE_BASE = MBED_APP_START;
25+
}
2126
}
2227
define symbol RDA_CODE_END = RDA_CODE_BASE + 0x1F3FFF;
2328
define symbol RDA_AHB1_BASE = 0x40100000;

targets/TARGET_RDA/TARGET_UNO_91H/flash_api.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
#include "flash_data.h"
1919
#include "mbed_critical.h"
2020

21+
#ifndef MBED_ROM_SIZE
22+
#define MBED_FLASH_SIZE 0x100000
23+
#else
24+
//there is 4K BOOTROM at beginning of the flash
25+
#define MBED_FLASH_SIZE (MBED_ROM_SIZE+0x1000)
26+
#endif
27+
28+
2129
// This file is automagically generated
2230

2331
// This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM
@@ -68,7 +76,7 @@ static const sector_info_t sectors_info[] = {
6876
static const flash_target_config_t flash_target_config = {
6977
.page_size = 0x100,
7078
.flash_start = 0x18000000,
71-
.flash_size = 0x100000,
79+
.flash_size = MBED_FLASH_SIZE,
7280
.sectors = sectors_info,
7381
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
7482
};

targets/TARGET_RDA/mbed_rtx.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,12 @@ extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Length[];
4242
#error "no toolchain defined"
4343
#endif
4444

45+
#if defined(TARGET_UNO_91H)
46+
/* Stack Pointer */
47+
#ifndef INITIAL_SP
48+
#define INITIAL_SP (0x120000UL)
49+
//#define INITIAL_SP (0x1A8000UL)
50+
#endif
51+
#endif
52+
4553
#endif // MBED_MBED_RTX_H

targets/targets.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8519,6 +8519,13 @@
85198519
"UNO_91H": {
85208520
"inherits": ["RDA5981X"],
85218521
"detect_code": ["8001"],
8522+
"components_add": ["FLASHIAP"],
8523+
"bootloader_supported": true,
8524+
"mbed_ram_start": "0x00100080",
8525+
"mbed_ram_size": "0x1ff80",
8526+
"mbed_rom_start": "0x18001000",
8527+
"mbed_rom_size": "0x1F4000",
8528+
"sectors": [[0,4096]],
85228529
"overrides": {
85238530
"network-default-interface-type" : "WIFI"
85248531
}

0 commit comments

Comments
 (0)