Skip to content

rtl8195am: fix ARM section error #6226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include "hal_adc.h"
#include "analogin_api.h"


#ifdef CONFIG_MBED_ENABLED
#include "platform_stdlib.h"
#endif

#if CONFIG_ADC_EN
#include "pinmap.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ LR_IRAM 0x10007000 (0x70000 - 0x7000) {
*libc.a (+RW)
*(.sdram.data*)
*lib_peripheral_mbed_arm.ar (+RW)
}

RW_IRAM2 +0 UNINIT FIXED {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the main thing that this PR is doing is replacing RAM2 block usage with the RAM1 block?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some part of the memory at the end of RAM2 which contains data that we donot want to touch throughout the lifecycle of the program. RAM2 block usage might create a scenario where the memory might reach the addresses that we donot wish to touch, hence we have replaced RAM2 block usage with RAM1.

*rtl8195a_crypto*.o(+ZI, COMMON)
*libc.a (+ZI, COMMON)
*(.bss.thread_stack_main)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#if defined(__CC_ARM) || \
(defined (__ARMCC_VERSION) && __ARMCC_VERSION >= 6010050)

extern uint8_t Image$$RW_IRAM2$$ZI$$Base[];
extern uint8_t Image$$RW_IRAM2$$ZI$$Limit[];
extern uint8_t Image$$RW_IRAM1$$ZI$$Base[];
extern uint8_t Image$$RW_IRAM1$$ZI$$Limit[];
extern uint8_t Image$$TCM_OVERLAY$$ZI$$Base[];
extern uint8_t Image$$TCM_OVERLAY$$ZI$$Limit[];
extern uint8_t Image$$RW_DRAM2$$ZI$$Base[];
extern uint8_t Image$$RW_DRAM2$$ZI$$Limit[];
#define __bss_sram_start__ Image$$RW_IRAM2$$ZI$$Base
#define __bss_sram_end__ Image$$RW_IRAM2$$ZI$$Limit
#define __bss_sram_start__ Image$$RW_IRAM1$$ZI$$Base
#define __bss_sram_end__ Image$$RW_IRAM1$$ZI$$Limit
#define __bss_dtcm_start__ Image$$TCM_OVERLAY$$ZI$$Base
#define __bss_dtcm_end__ Image$$TCM_OVERLAY$$ZI$$Limit
#define __bss_dram_start__ Image$$RW_DRAM2$$ZI$$Base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include "objects.h"
#include "log_uart_api.h"

#ifdef CONFIG_MBED_ENABLED
#include "platform_stdlib.h"
#endif

#include <string.h>

const u32 log_uart_support_rate[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#include "objects.h"
#include "pinmap.h"

#ifdef CONFIG_MBED_ENABLED
#include "platform_stdlib.h"
#endif

#if DEVICE_PWMOUT

#ifdef CONFIG_PWM_EN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#include "rtl8195a.h"
#include "objects.h"
#include "serial_api.h"

#ifdef CONFIG_MBED_ENABLED
#include "platform_stdlib.h"
#endif

#if CONFIG_UART_EN

#include "pinmap.h"
Expand Down
4 changes: 4 additions & 0 deletions targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/spi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include "pinmap.h"
#include "hal_ssi.h"

#ifdef CONFIG_MBED_ENABLED
#include "platform_stdlib.h"
#endif

extern u32 SystemGetCpuClk(VOID);
extern VOID HAL_GPIO_PullCtrl(u32 pin, u32 mode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include "analogin_api.h"
#include "analogin_ext.h"

#ifdef CONFIG_MBED_ENABLED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these new #ifdefs enabling that wasn't enabled before?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our platform has its own std libraries that are defined under platform_stdlib.h, some of these define are modified to support our specific realtek platform and are different from the original stdlib.h hence we have this define enabled here.

#include "platform_stdlib.h"
#endif

#ifdef DEVICE_TRNG


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <stdint.h>
#include "diag.h"
#define strsep(str, delim) _strsep(str, delim)
#define _memset(dst, val, sz) memset(dst, val, sz)
#else
#include <stdio.h>
#include <stdlib.h>
Expand Down