Skip to content

Commit 7c1afa8

Browse files
authored
Merge pull request #2865 from HiFiPhile/rt1170
RT1170 enhancements
2 parents b1eae1e + 22a6777 commit 7c1afa8

File tree

61 files changed

+1371
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1371
-1048
lines changed

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
html
22
latex
3+
*.a
34
*.d
45
*.o
56
*.P
6-
*.map
77
*.axf
88
*.bin
9-
*.jlink
10-
*.emSession
119
*.elf
10+
*.env
1211
*.ind
13-
.env
12+
*.log
13+
*.map
14+
*.obj
15+
*.jlink
16+
*.emSession
17+
*.ninja*
1418
.settings/
1519
.vscode/
1620
.gdb_history

examples/device/audio_test_multi_rate/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1];
8585

8686

8787
// Audio test data
88-
CFG_TUSB_MEM_ALIGN uint8_t test_buffer_audio[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
88+
CFG_TUD_MEM_ALIGN uint8_t test_buffer_audio[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
8989
uint16_t startVal = 0;
9090

9191
void led_blinking_task(void);

hw/bsp/broadcom_32bit/family.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ function(family_configure_example TARGET RTOS)
106106
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
107107

108108
# Flashing
109+
family_add_bin_hex(${TARGET})
109110
family_flash_jlink(${TARGET})
110111
endfunction()

hw/bsp/broadcom_64bit/family.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,6 @@ function(family_configure_example TARGET RTOS)
113113
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
114114

115115
# Flashing
116+
family_add_bin_hex(${TARGET})
116117
family_flash_jlink(${TARGET})
117118
endfunction()

hw/bsp/f1c100s/family.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,6 @@ function(family_configure_example TARGET RTOS)
110110
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
111111

112112
# Flashing
113+
family_add_bin_hex(${TARGET})
113114
family_flash_jlink(${TARGET})
114115
endfunction()

hw/bsp/family_support.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,17 @@ endfunction()
300300

301301
# Add bin/hex output
302302
function(family_add_bin_hex TARGET)
303-
add_custom_command(TARGET ${TARGET} POST_BUILD
304-
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
305-
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
306-
VERBATIM)
303+
if (CMAKE_C_COMPILER_ID STREQUAL "IAR")
304+
add_custom_command(TARGET ${TARGET} POST_BUILD
305+
COMMAND ${CMAKE_OBJCOPY} --bin $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
306+
COMMAND ${CMAKE_OBJCOPY} --ihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
307+
VERBATIM)
308+
else()
309+
add_custom_command(TARGET ${TARGET} POST_BUILD
310+
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.bin
311+
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex
312+
VERBATIM)
313+
endif()
307314
endfunction()
308315

309316
# Add uf2 output

hw/bsp/gd32vf103/family.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@ function(family_configure_example TARGET RTOS)
117117
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
118118

119119
# Flashing
120+
family_add_bin_hex(${TARGET})
120121
family_flash_jlink(${TARGET})
121122
endfunction()

hw/bsp/imxrt/boards/mimxrt1170_evkb/board.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
set(MCU_VARIANT MIMXRT1176)
2-
set(MCU_CORE _cm7)
32

4-
set(JLINK_DEVICE MIMXRT1176xxxA_M7)
5-
set(PYOCD_TARGET mimxrt1170_cm7)
3+
if (M4 STREQUAL "1")
4+
set(MCU_CORE _cm4)
5+
set(JLINK_CORE _M4)
6+
set(LD_FILE_GNU ${SDK_DIR}/devices/${MCU_VARIANT}/gcc/${MCU_VARIANT}xxxxx${MCU_CORE}_ram.ld)
7+
set(CMAKE_SYSTEM_PROCESSOR cortex-m4 CACHE INTERNAL "System Processor")
8+
else ()
9+
set(MCU_CORE _cm7)
10+
set(JLINK_CORE _M7)
11+
endif()
12+
13+
set(JLINK_DEVICE MIMXRT1176xxxA${JLINK_CORE})
14+
set(PYOCD_TARGET mimxrt1170${MCU_CORE})
615
set(NXPLINK_DEVICE MIMXRT1176xxxxx:MIMXRT1170-EVK)
716

817
function(update_board TARGET)
918
target_sources(${TARGET} PUBLIC
1019
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/evkbmimxrt1170_flexspi_nor_config.c
1120
)
1221
target_compile_definitions(${TARGET} PUBLIC
13-
CPU_MIMXRT1176DVMAA_cm7
22+
CPU_MIMXRT1176DVMAA${MCU_CORE}
1423
BOARD_TUD_RHPORT=0
1524
BOARD_TUH_RHPORT=1
1625
)

hw/bsp/imxrt/boards/mimxrt1170_evkb/board.mk

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
CFLAGS += -DCPU_MIMXRT1176DVMAA_cm7
21
MCU_VARIANT = MIMXRT1176
3-
MCU_CORE = _cm7
2+
3+
ifeq ($(M4), 1)
4+
MCU_CORE = _cm4
5+
JLINK_CORE = _M4
6+
CPU_CORE = cortex-m4
7+
LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_VARIANT)xxxxx${MCU_CORE}_ram.ld
8+
else
9+
MCU_CORE = _cm7
10+
JLINK_CORE = _M7
11+
endif
12+
13+
CFLAGS += -DCPU_MIMXRT1176DVMAA$(MCU_CORE)
414

515
# For flash-jlink target
6-
JLINK_DEVICE = MIMXRT1176xxxA_M7
16+
JLINK_DEVICE = MIMXRT1176xxxA$(JLINK_CORE)
717

818
# For flash-pyocd target
9-
PYOCD_TARGET = mimxrt1170_cm7
19+
PYOCD_TARGET = mimxrt1170$(MCU_CORE)
1020

1121
BOARD_TUD_RHPORT = 0
1222
BOARD_TUH_RHPORT = 1

hw/bsp/imxrt/boards/mimxrt1170_evkb/board/clock_config.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
1313
!!GlobalInfo
14-
product: Clocks v12.0
14+
product: Clocks v14.0
1515
processor: MIMXRT1176xxxxx
1616
package_id: MIMXRT1176DVMAA
1717
mcu_data: ksdk2_0
18-
processor_version: 14.0.1
18+
processor_version: 16.3.0
1919
board: MIMXRT1170-EVKB
2020
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
2121

@@ -335,7 +335,6 @@ void BOARD_BootClockRUN(void)
335335

336336
/* Init OSC RC 400M */
337337
CLOCK_OSC_EnableOscRc400M();
338-
CLOCK_OSC_GateOscRc400M(false);
339338

340339
/* Init OSC RC 48M */
341340
CLOCK_OSC_EnableOsc48M(true);
@@ -349,22 +348,29 @@ void BOARD_BootClockRUN(void)
349348
{
350349
}
351350

352-
/* Switch both core, M7 Systick and Bus_Lpsr to OscRC48MDiv2 first */
351+
/* Switch core M7 clock root to OscRC48MDiv2 first */
353352
#if __CORTEX_M == 7
354353
rootCfg.mux = kCLOCK_M7_ClockRoot_MuxOscRc48MDiv2;
355354
rootCfg.div = 1;
356355
CLOCK_SetRootClock(kCLOCK_Root_M7, &rootCfg);
356+
#endif
357357

358+
/* Switch core M7 systick clock root to OscRC48MDiv2 first */
359+
#if __CORTEX_M == 7
358360
rootCfg.mux = kCLOCK_M7_SYSTICK_ClockRoot_MuxOscRc48MDiv2;
359361
rootCfg.div = 1;
360362
CLOCK_SetRootClock(kCLOCK_Root_M7_Systick, &rootCfg);
361363
#endif
362364

365+
/* Switch core M4 clock root to OscRC48MDiv2 first */
363366
#if __CORTEX_M == 4
364367
rootCfg.mux = kCLOCK_M4_ClockRoot_MuxOscRc48MDiv2;
365368
rootCfg.div = 1;
366369
CLOCK_SetRootClock(kCLOCK_Root_M4, &rootCfg);
370+
#endif
367371

372+
/* Switch the Bus_Lpsr clock root to OscRC48MDiv2 first */
373+
#if __CORTEX_M == 4
368374
rootCfg.mux = kCLOCK_BUS_LPSR_ClockRoot_MuxOscRc48MDiv2;
369375
rootCfg.div = 1;
370376
CLOCK_SetRootClock(kCLOCK_Root_Bus_Lpsr, &rootCfg);

0 commit comments

Comments
 (0)