Skip to content

Commit 22fb664

Browse files
committed
update linker
1 parent 99e75e6 commit 22fb664

File tree

15 files changed

+375
-727
lines changed

15 files changed

+375
-727
lines changed
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
/*
2+
* FreeRTOS Kernel V10.0.0
3+
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
* this software and associated documentation files (the "Software"), to deal in
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so,
10+
* subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software. If you wish to use our Amazon
14+
* FreeRTOS name, please do so in a fair use way that does not cause confusion.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*
23+
* http://www.FreeRTOS.org
24+
* http://aws.amazon.com/freertos
25+
*
26+
* 1 tab == 4 spaces!
27+
*/
28+
29+
30+
#ifndef FREERTOS_CONFIG_H
31+
#define FREERTOS_CONFIG_H
32+
33+
/*-----------------------------------------------------------
34+
* Application specific definitions.
35+
*
36+
* These definitions should be adjusted for your particular hardware and
37+
* application requirements.
38+
*
39+
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
40+
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
41+
*
42+
* See http://www.freertos.org/a00110.html.
43+
*----------------------------------------------------------*/
44+
45+
// skip if included from IAR assembler
46+
#ifndef __IASMARM__
47+
48+
#ifdef __GNUC__
49+
#pragma GCC diagnostic push
50+
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
51+
#pragma GCC diagnostic ignored "-Wundef"
52+
53+
// extra push due to https://github.com/renesas/fsp/pull/278
54+
#pragma GCC diagnostic push
55+
#endif
56+
57+
#include "bsp_api.h"
58+
59+
#ifdef __GNUC__
60+
#pragma GCC diagnostic pop
61+
#endif
62+
63+
#endif
64+
65+
/* Cortex M23/M33 port configuration. */
66+
#define configENABLE_MPU 0
67+
#define configENABLE_FPU 1
68+
#define configENABLE_TRUSTZONE 0
69+
#define configMINIMAL_SECURE_STACK_SIZE (1024)
70+
71+
#define configUSE_PREEMPTION 1
72+
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
73+
#define configCPU_CLOCK_HZ SystemCoreClock
74+
#define configTICK_RATE_HZ ( 1000 )
75+
#define configMAX_PRIORITIES ( 5 )
76+
#define configMINIMAL_STACK_SIZE ( 128 )
77+
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
78+
#define configMAX_TASK_NAME_LEN 16
79+
#define configUSE_16_BIT_TICKS 0
80+
#define configIDLE_SHOULD_YIELD 1
81+
#define configUSE_MUTEXES 1
82+
#define configUSE_RECURSIVE_MUTEXES 1
83+
#define configUSE_COUNTING_SEMAPHORES 1
84+
#define configQUEUE_REGISTRY_SIZE 2
85+
#define configUSE_QUEUE_SETS 0
86+
#define configUSE_TIME_SLICING 0
87+
#define configUSE_NEWLIB_REENTRANT 0
88+
#define configENABLE_BACKWARD_COMPATIBILITY 1
89+
#define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP 0
90+
91+
#define configSUPPORT_STATIC_ALLOCATION 0
92+
#define configSUPPORT_DYNAMIC_ALLOCATION 1
93+
94+
/* Hook function related definitions. */
95+
#define configUSE_IDLE_HOOK 0
96+
#define configUSE_TICK_HOOK 0
97+
#define configUSE_MALLOC_FAILED_HOOK 0 // cause nested extern warning
98+
#define configCHECK_FOR_STACK_OVERFLOW 2
99+
100+
/* Run time and task stats gathering related definitions. */
101+
#define configGENERATE_RUN_TIME_STATS 0
102+
#define configRECORD_STACK_HIGH_ADDRESS 1
103+
#define configUSE_TRACE_FACILITY 1 // legacy trace
104+
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
105+
106+
/* Co-routine definitions. */
107+
#define configUSE_CO_ROUTINES 0
108+
#define configMAX_CO_ROUTINE_PRIORITIES 2
109+
110+
/* Software timer related definitions. */
111+
#define configUSE_TIMERS 1
112+
#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES-2)
113+
#define configTIMER_QUEUE_LENGTH 32
114+
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
115+
116+
/* Optional functions - most linkers will remove unused functions anyway. */
117+
#define INCLUDE_vTaskPrioritySet 0
118+
#define INCLUDE_uxTaskPriorityGet 0
119+
#define INCLUDE_vTaskDelete 0
120+
#define INCLUDE_vTaskSuspend 1 // required for queue, semaphore, mutex to be blocked indefinitely with portMAX_DELAY
121+
#define INCLUDE_xResumeFromISR 0
122+
#define INCLUDE_vTaskDelayUntil 1
123+
#define INCLUDE_vTaskDelay 1
124+
#define INCLUDE_xTaskGetSchedulerState 0
125+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
126+
#define INCLUDE_uxTaskGetStackHighWaterMark 0
127+
#define INCLUDE_xTaskGetIdleTaskHandle 0
128+
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
129+
#define INCLUDE_pcTaskGetTaskName 0
130+
#define INCLUDE_eTaskGetState 0
131+
#define INCLUDE_xEventGroupSetBitFromISR 0
132+
#define INCLUDE_xTimerPendFunctionCall 0
133+
134+
/* Define to trap errors during development. */
135+
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
136+
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
137+
#define configASSERT(_exp) \
138+
do {\
139+
if ( !(_exp) ) { \
140+
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
141+
if ( (*ARM_CM_DHCSR) & 1UL ) { /* Only halt mcu if debugger is attached */ \
142+
taskDISABLE_INTERRUPTS(); \
143+
__asm("BKPT #0\n"); \
144+
}\
145+
}\
146+
} while(0)
147+
#else
148+
#define configASSERT( x )
149+
#endif
150+
151+
/* FreeRTOS hooks to NVIC vectors */
152+
#define xPortPendSVHandler PendSV_Handler
153+
#define xPortSysTickHandler SysTick_Handler
154+
#define vPortSVCHandler SVC_Handler
155+
156+
//--------------------------------------------------------------------+
157+
// Interrupt nesting behavior configuration.
158+
//--------------------------------------------------------------------+
159+
160+
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in mcu header
161+
#define configPRIO_BITS __NVIC_PRIO_BITS
162+
163+
/* The lowest interrupt priority that can be used in a call to a "set priority" function. */
164+
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY ((1<<configPRIO_BITS) - 1)
165+
166+
/* The highest interrupt priority that can be used by any interrupt service
167+
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
168+
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
169+
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
170+
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 2
171+
172+
/* Interrupt priorities used by the kernel port layer itself. These are generic
173+
to all Cortex-M ports, and do not rely on any particular library functions. */
174+
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
175+
176+
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
177+
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
178+
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
179+
180+
#endif

hw/bsp/ra/boards/ra4m1_ek/board.cmake

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@ set(MCU_VARIANT ra4m1)
33

44
set(JLINK_DEVICE R7FA4M1AB)
55

6-
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/ra4m1_ek.ld)
7-
86
function(update_board TARGET)
9-
target_compile_definitions(${TARGET} PUBLIC
10-
)
11-
target_sources(${TARGET} PRIVATE
12-
)
13-
target_include_directories(${BOARD_TARGET} PUBLIC
14-
)
7+
target_compile_definitions(${TARGET} PUBLIC)
8+
target_sources(${TARGET} PRIVATE)
9+
target_include_directories(${BOARD_TARGET} PUBLIC)
1510
endfunction()

hw/bsp/ra/boards/ra4m1_ek/board.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@
3131
extern "C" {
3232
#endif
3333

34-
#define LED1 (BSP_IO_PORT_01_PIN_06)
35-
#define LED_STATE_ON 1
34+
#define LED1 BSP_IO_PORT_01_PIN_06
35+
#define LED_STATE_ON 1
3636

37-
#define SW1 (BSP_IO_PORT_01_PIN_05)
37+
#define SW1 BSP_IO_PORT_01_PIN_05
3838
#define BUTTON_STATE_ACTIVE 0
3939

4040
const ioport_pin_cfg_t board_pin_cfg[] = {
41-
{ .pin = LED1, .pin_cfg = ((uint32_t) IOPORT_CFG_PORT_DIRECTION_OUTPUT | (uint32_t) IOPORT_CFG_PORT_OUTPUT_LOW) },
42-
{ .pin = SW1 , .pin_cfg = ((uint32_t) IOPORT_CFG_PORT_DIRECTION_INPUT) },
43-
44-
{ .pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS) },
45-
{ .pin = BSP_IO_PORT_09_PIN_14, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS) },
46-
{ .pin = BSP_IO_PORT_09_PIN_15, .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_USB_FS) },
41+
{.pin = LED1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_OUTPUT},
42+
{.pin = SW1, .pin_cfg = IOPORT_CFG_PORT_DIRECTION_INPUT},
43+
// USB D+, D-, VBus
44+
{.pin = BSP_IO_PORT_04_PIN_07, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
45+
{.pin = BSP_IO_PORT_09_PIN_14, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
46+
{.pin = BSP_IO_PORT_09_PIN_15, .pin_cfg = IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS},
4747
};
4848

4949
#ifdef __cplusplus

hw/bsp/ra/boards/ra4m1_ek/board.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
CPU_CORE = cortex-m4
22
MCU_VARIANT = ra4m1
33

4-
FSP_BOARD_DIR = hw/mcu/renesas/fsp/ra/board/ra4m1_ek
5-
6-
# All source paths should be relative to the top level.
7-
LD_FILE = $(BOARD_PATH)/ra4m1_ek.ld
8-
94
# For flash-jlink target
105
JLINK_DEVICE = R7FA4M1AB
116
JLINK_IF = SWD

hw/bsp/ra/boards/ra4m3_ek/board.cmake

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@ set(MCU_VARIANT ra4m3)
33

44
set(JLINK_DEVICE R7FA4M3AF)
55

6-
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/ra4m3_ek.ld)
7-
86
function(update_board TARGET)
9-
target_compile_definitions(${TARGET} PUBLIC
10-
)
11-
target_sources(${TARGET} PRIVATE
12-
)
13-
target_include_directories(${BOARD_TARGET} PUBLIC
14-
)
7+
target_compile_definitions(${TARGET} PUBLIC)
8+
target_sources(${TARGET} PRIVATE)
9+
target_include_directories(${BOARD_TARGET} PUBLIC)
1510
endfunction()

hw/bsp/ra/boards/ra4m3_ek/board.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
CPU_CORE = cortex-m33
22
MCU_VARIANT = ra4m3
33

4-
FSP_BOARD_DIR = hw/mcu/renesas/fsp/ra/board/ra4m3_ek
5-
6-
# All source paths should be relative to the top level.
7-
LD_FILE = $(BOARD_PATH)/ra4m3_ek.ld
8-
94
# For flash-jlink target
105
JLINK_DEVICE = R7FA4M3AF
116
JLINK_IF = SWD

0 commit comments

Comments
 (0)