Skip to content

Commit 7867a81

Browse files
Archcady0xc0170
authored andcommitted
WiFi test fix for GCC
right now still need to add flag in gcc.py, we are fixing!
1 parent 6a47d01 commit 7867a81

File tree

4 files changed

+34
-38
lines changed

4 files changed

+34
-38
lines changed

targets/TARGET_Realtek/TARGET_AMEBA/RTWInterface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
RTWInterface::RTWInterface()
3131
: _dhcp(true), _ip_address(), _netmask(), _gateway()
3232
{
33+
nsapi_error_t ret;
34+
ret = init();
35+
if (ret != NSAPI_ERROR_OK){
36+
printf("Error init RTWInterface!(%d)\r\n", ret);
37+
}
3338
}
3439

3540
static void *scan_sema;

targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/device/TOOLCHAIN_GCC_ARM/rlx8195A-symbol-v02-img2.ld

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
/*
2+
* Copyright (c) 2013-2016 Realtek Semiconductor Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116

217

318
ENTRY(Reset_Handler)
419

20+
/*INCLUDE "mbed-os/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/device/TOOLCHAIN_GCC_ARM/export-rom_v02.txt"*/
521
SECTIONS
622
{
723
__vectors_table = 0x0;
@@ -653,6 +669,7 @@ SECTIONS
653669
MEMORY
654670
{
655671
TCM (rwx) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
672+
ROM_USED_RAM (rwx) : ORIGIN = 0x10000bc8, LENGTH = 0x10006000-0x10000bc8
656673
DATA_RAM (rwx) : ORIGIN = 0x10002100, LENGTH = 0x10006000 - 0x10002100
657674
BD_RAM (rwx) : ORIGIN = 0x10006000, LENGTH = 0x10070000 - 0x10006000
658675
SD_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 2M
@@ -691,7 +708,12 @@ SECTIONS
691708
__rom_bss_start__ = 0x10000300;
692709
__rom_bss_end__ = 0x10000bc8;
693710
__ram_table_start__ = 0x10000bc8;
694-
711+
/*
712+
.ram.start.table :
713+
{
714+
715+
} > ROM_USED_RAM
716+
*/
695717
.image2.table :
696718
{
697719
__image2_start__ = .;
@@ -803,40 +825,11 @@ SECTIONS
803825
__HeapLimit = .;
804826
} > BD_RAM
805827

806-
/*
807828
.TCM_overlay :
808829
{
809830
*(.tcm.heap*)
810831
} > TCM
811-
812-
813-
.sdr_text :
814-
{
815-
__image3_start__ = .;
816-
*(.sdram.text*)
817-
*(.p2p.text*)
818-
*(.wps.text*)
819-
*(.websocket.text*)
820-
} > SD_RAM
821-
822-
.sdr_rodata :
823-
{
824-
*(.sdram.rodata*)
825-
*(.p2p.rodata*)
826-
*(.wps.rodata*)
827-
*(.websocket.rodata*)
828-
} > SD_RAM
829-
830-
.sdr_bss :
831-
{
832-
__sdram_bss_start__ = .;
833-
*(.sdram.bss*)
834-
*(.p2p.bss*)
835-
*(.wps.bss*)
836-
*(.websocket.bss*)
837-
__sdram_bss_end__ = .;
838-
} > SD_RAM
839-
*/
832+
840833
/* .stack_dummy section doesn't contains any symbols. It is only
841834
* used for linker to calculate size of stack sections, and assign
842835
* values to stack symbols later */
@@ -854,11 +847,5 @@ SECTIONS
854847
/* Check if data + heap + stack exceeds RAM limit */
855848
ASSERT(__StackLimit >= __HeapLimit, "region RAM exceeds ram limit")
856849

857-
.sdr_data :
858-
{
859-
__sdram_data_start__ = .;
860-
*(.sdram.data*)
861-
__sdram_data_end__ = .;
862-
} > SD_RAM
863850
}
864851

targets/TARGET_Realtek/TARGET_AMEBA/sdk/os/rtx/rtx_service.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ u8* _rtx_zmalloc(u32 sz)
115115
_func_enter_;
116116
u8 *pbuf = _rtx_malloc(sz);
117117

118-
if (pbuf != NULL)
118+
if (pbuf != NULL){
119119
#if USE_HEAP_INFO
120120
osFreeBytesRemaining-=sz;
121121
#endif
122122
_rtx_memset(pbuf, 0, sz);
123+
}
123124
_func_exit_;
124125
return pbuf;
125126
}

tools/toolchains/gcc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def __init__(self, target, notify=None, macros=None,
9191
self.cppc =[main_cppc]
9292
self.cc += self.flags['c'] + self.flags['common']
9393
self.cppc += self.flags['cxx'] + self.flags['common']
94+
if target.name in ["REALTEK_RTL8195AM"]:
95+
self.cc += ["-fno-short-enums"]
96+
self.cppc += ["-fno-short-enums"]
9497

9598
self.flags['ld'] += self.cpu
9699
self.ld = [join(tool_path, "arm-none-eabi-gcc")] + self.flags['ld']

0 commit comments

Comments
 (0)