soc/esp32: Move logging library to IRAM with CONFIG_LOG_MINIMAL

This commit updates linker script to move minimal log module to internal
RAM

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
This commit is contained in:
Shubham Kulkarni 2021-01-15 12:03:57 +05:30 committed by Anas Nashif
commit d621dad21b
3 changed files with 10 additions and 4 deletions

View file

@ -20,6 +20,7 @@
#include <drivers/clock_control.h>
#include <errno.h>
#include <sys/util.h>
#include <esp_attr.h>
/*
@ -141,7 +142,7 @@ static int uart_esp32_poll_in(const struct device *dev, unsigned char *p_char)
return 0;
}
static void uart_esp32_poll_out(const struct device *dev,
static IRAM_ATTR void uart_esp32_poll_out(const struct device *dev,
unsigned char c)
{
/* Wait for space in FIFO */
@ -443,7 +444,7 @@ void uart_esp32_isr(const struct device *dev)
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
static const struct uart_driver_api uart_esp32_api = {
static const DRAM_ATTR struct uart_driver_api uart_esp32_api = {
.poll_in = uart_esp32_poll_in,
.poll_out = uart_esp32_poll_out,
.err_check = uart_esp32_err_check,
@ -495,7 +496,7 @@ static const struct uart_driver_api uart_esp32_api = {
#endif
#define ESP32_UART_INIT(idx) \
ESP32_UART_IRQ_HANDLER_DECL(idx); \
static const struct uart_esp32_config uart_esp32_cfg_port_##idx = { \
static const DRAM_ATTR struct uart_esp32_config uart_esp32_cfg_port_##idx = { \
.dev_conf = { \
.base = \
(uint8_t *)DT_INST_REG_ADDR(idx), \

View file

@ -59,6 +59,7 @@ PROVIDE ( esp32_rom_ets_delay_us = ets_delay_us );
/* __udivdi3 is exported using assignment, which declares strong symbols */
__udivdi3 = 0x4000cff8;
__umoddi3 = 0x4000d280;
MEMORY
{
@ -257,6 +258,7 @@ _net_buf_pool_list = _esp_net_buf_pool_list;
* when flash cache is disabled */
*libarch__xtensa__core.a:(.rodata .rodata.*)
*libkernel.a:fatal.*(.rodata .rodata.*)
*libzephyr.a:cbprintf_complete*(.rodata .rodata.*)
KEEP(*(.jcr))
*(.dram1 .dram1.*)
_data_end = ABSOLUTE(.);
@ -370,6 +372,9 @@ __shell_root_cmds_end = __esp_shell_root_cmds_end;
*libzephyr.a:log_noos.*(.literal .text .literal.* .text.*)
*libzephyr.a:xtensa_sys_timer.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_core.*(.literal .text .literal.* .text.*)
*libzephyr.a:cbprintf_complete.*(.literal .text .literal.* .text.*)
*libzephyr.a:printk.*(.literal.printk .literal.vprintk .literal.char_out .text.printk .text.vprintk .text.char_out)
*libzephyr.a:uart_console.*(.literal.console_out .text.console_out)
*liblib__libc__minimal.a:string.*(.literal .text .literal.* .text.*)
*libgcov.a:(.literal .text .literal.* .text.*)
*libnet80211.a:( .wifi0iram .wifi0iram.*)

View file

@ -102,7 +102,7 @@ void __attribute__((section(".iram1"))) __start(void)
}
/* Boot-time static default printk handler, possibly to be overridden later. */
int arch_printk_char_out(int c)
int IRAM_ATTR arch_printk_char_out(int c)
{
if (c == '\n') {
esp32_rom_uart_tx_one_char('\r');