Skip to content

Commit ae0f05f

Browse files
fredlee12001adbridge
authored andcommitted
Add configuration to support PDMC compile Configurable flash size for UNO_91H
1 parent 01391fa commit ae0f05f

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

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/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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8509,6 +8509,14 @@
85098509
"UNO_91H": {
85108510
"inherits": ["RDA5981X"],
85118511
"detect_code": ["8001"],
8512+
"components_add": ["FLASHIAP"],
8513+
"bootloader_supported": true,
8514+
"mbed_ram_start": "0x00100080",
8515+
"mbed_ram_size": "0x1ff80",
8516+
"mbed_rom_start": "0x18001000",
8517+
"mbed_rom_size": "0x1F4000",
8518+
"device_name": "RDA5981X",
8519+
"sectors": [[0,4096]],
85128520
"overrides": {
85138521
"network-default-interface-type" : "WIFI"
85148522
}

0 commit comments

Comments
 (0)