From f8d6db31fec047bd3cc8530b7b2ae7009d90a295 Mon Sep 17 00:00:00 2001 From: Andelf Date: Sun, 24 Nov 2024 19:22:40 +0800 Subject: [PATCH] fix: demo build --- examples/hpm6200evk/.cargo/config.toml | 2 +- examples/hpm6200evk/Cargo.toml | 8 +- examples/hpm6200evk/link-fixed.x | 229 ------------------ examples/hpm6200evk/memory-ram.x | 8 +- examples/hpm6200evk/memory-xip.x | 7 +- examples/hpm6200evk/memory.x | 7 +- examples/hpm6300evk/.cargo/config.toml | 2 +- examples/hpm6300evk/Cargo.toml | 3 +- examples/hpm6300evk/link-fixed.x | 229 ------------------ examples/hpm6300evk/memory-ram.x | 7 +- examples/hpm6300evk/memory-xip.x | 6 +- examples/hpm6300evk/memory.x | 7 +- examples/hpm6300evk/src/bin/raw_blinky.rs | 2 +- examples/hpm6300evk/src/bin/rtt.rs | 2 +- examples/hpm6750evkmini/.cargo/config.toml | 26 +- examples/hpm6750evkmini/Cargo.toml | 5 +- examples/hpm6750evkmini/link-fixed.x | 229 ------------------ examples/hpm6750evkmini/memory.x | 10 +- .../hpm6750evkmini/openocd-semihosting.gdb | 2 +- .../riscv32imafdcp-unknown-none-elf.json | 24 ++ examples/hpm6750evkmini/src/bin/raw_blinky.rs | 2 +- examples/hpm6750evkmini/src/bin/raw_pwm.rs | 9 +- .../hpm6750evkmini/src/bin/semihosting.rs | 6 +- examples/hpm6750evkmini/src/bin/spi_st7789.rs | 2 +- examples/hpm6750evkmini/src/bin/uart_async.rs | 2 +- examples/hpm6750evkmini/src/bin/usb.rs | 2 +- examples/hpm6750evkmini/src/lib.rs | 176 ++++++++++++++ examples/hpm6e00evk/.cargo/config.toml | 2 +- examples/hpm6e00evk/Cargo.toml | 19 +- examples/hpm6e00evk/link-fixed.x | 229 ------------------ examples/hpm6e00evk/memory.x | 7 +- src/sysctl/v68.rs | 1 - src/sysctl/v6e.rs | 1 - 33 files changed, 294 insertions(+), 979 deletions(-) delete mode 100644 examples/hpm6200evk/link-fixed.x delete mode 100644 examples/hpm6300evk/link-fixed.x delete mode 100644 examples/hpm6750evkmini/link-fixed.x create mode 100644 examples/hpm6750evkmini/riscv32imafdcp-unknown-none-elf.json delete mode 100644 examples/hpm6e00evk/link-fixed.x diff --git a/examples/hpm6200evk/.cargo/config.toml b/examples/hpm6200evk/.cargo/config.toml index 2ffb9f1..a127303 100644 --- a/examples/hpm6200evk/.cargo/config.toml +++ b/examples/hpm6200evk/.cargo/config.toml @@ -13,7 +13,7 @@ rustflags = [ "-C", "link-arg=-Tdevice.x", # __VECTORED_INTERRUPTS "-C", - "link-arg=-Tlink-fixed.x", + "link-arg=-Tlink.x", "-C", "link-arg=-Tdefmt.x", "-C", diff --git a/examples/hpm6200evk/Cargo.toml b/examples/hpm6200evk/Cargo.toml index 12a071d..fda120e 100644 --- a/examples/hpm6200evk/Cargo.toml +++ b/examples/hpm6200evk/Cargo.toml @@ -9,20 +9,20 @@ hpm-hal = { path = "../..", features = ["rt", "embassy", "hpm6280"] } # embedded helper libraries defmt = "0.3.8" defmt-rtt = "0.4.1" -panic-halt = "0.2.0" +panic-halt = "1.0.0" assign-resources = "0.4.1" heapless = "0.8.0" # embassy dependencies embassy-time = { version = "0.3.0", features = ["tick-hz-1_000_000"] } -embassy-executor = { version = "0.6.0", features = [ - "nightly", +embassy-executor = { version = "0.6.3", features = [ + # "nightly", "integrated-timers", "arch-riscv32", "executor-thread", ] } embassy-embedded-hal = "0.2.0" -embassy-sync = "0.6.0" +embassy-sync = "0.6.1" # embedded-hal ecosystem embedded-hal = "1.0.0" diff --git a/examples/hpm6200evk/link-fixed.x b/examples/hpm6200evk/link-fixed.x deleted file mode 100644 index d8b3813..0000000 --- a/examples/hpm6200evk/link-fixed.x +++ /dev/null @@ -1,229 +0,0 @@ -/* Temp fix for https://github.com/rust-embedded/riscv/issues/196 */ - -/* # Developer notes - -- Symbols that start with a double underscore (__) are considered "private" - -- Symbols that start with a single underscore (_) are considered "semi-public"; they can be - overridden in a user linker script, but should not be referred from user code (e.g. `extern "C" { - static mut _heap_size }`). - -- `EXTERN` forces the linker to keep a symbol in the final binary. We use this to make sure a - symbol if not dropped if it appears in or near the front of the linker arguments and "it's not - needed" by any of the preceding objects (linker arguments) - -- `PROVIDE` is used to provide default values that can be overridden by a user linker script - -- In this linker script, you may find symbols that look like `${...}` (e.g., `4`). - These are wildcards used by the `build.rs` script to adapt to different target particularities. - Check `build.rs` for more details about these symbols. - -- On alignment: it's important for correctness that the VMA boundaries of both .bss and .data *and* - the LMA of .data are all `4`-byte aligned. These alignments are assumed by the RAM - initialization routine. There's also a second benefit: `4`-byte aligned boundaries - means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`. -*/ - -PROVIDE(_stext = ORIGIN(REGION_TEXT)); -PROVIDE(_stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK)); -PROVIDE(_max_hart_id = 0); -PROVIDE(_hart_stack_size = 2K); -PROVIDE(_heap_size = 0); - -PROVIDE(InstructionMisaligned = ExceptionHandler); -PROVIDE(InstructionFault = ExceptionHandler); -PROVIDE(IllegalInstruction = ExceptionHandler); -PROVIDE(Breakpoint = ExceptionHandler); -PROVIDE(LoadMisaligned = ExceptionHandler); -PROVIDE(LoadFault = ExceptionHandler); -PROVIDE(StoreMisaligned = ExceptionHandler); -PROVIDE(StoreFault = ExceptionHandler);; -PROVIDE(UserEnvCall = ExceptionHandler); -PROVIDE(SupervisorEnvCall = ExceptionHandler); -PROVIDE(MachineEnvCall = ExceptionHandler); -PROVIDE(InstructionPageFault = ExceptionHandler); -PROVIDE(LoadPageFault = ExceptionHandler); -PROVIDE(StorePageFault = ExceptionHandler); - -PROVIDE(SupervisorSoft = DefaultHandler); -PROVIDE(MachineSoft = DefaultHandler); -PROVIDE(SupervisorTimer = DefaultHandler); -PROVIDE(MachineTimer = DefaultHandler); -PROVIDE(SupervisorExternal = DefaultHandler); -PROVIDE(MachineExternal = DefaultHandler); - -PROVIDE(DefaultHandler = DefaultInterruptHandler); -PROVIDE(ExceptionHandler = DefaultExceptionHandler); - -/* # Pre-initialization function */ -/* If the user overrides this using the `#[pre_init]` attribute or by creating a `__pre_init` function, - then the function this points to will be called before the RAM is initialized. */ -PROVIDE(__pre_init = default_pre_init); - -/* A PAC/HAL defined routine that should initialize custom interrupt controller if needed. */ -PROVIDE(_setup_interrupts = default_setup_interrupts); - -/* # Multi-processing hook function - fn _mp_hook() -> bool; - - This function is called from all the harts and must return true only for one hart, - which will perform memory initialization. For other harts it must return false - and implement wake-up in platform-dependent way (e.g. after waiting for a user interrupt). -*/ -PROVIDE(_mp_hook = default_mp_hook); - -/* # Start trap function override - By default uses the riscv crates default trap handler - but by providing the `_start_trap` symbol external crates can override. -*/ -PROVIDE(_start_trap = default_start_trap); - -SECTIONS -{ - .text.dummy (NOLOAD) : - { - /* This section is intended to make _stext address work */ - . = ABSOLUTE(_stext); - } > REGION_TEXT - - .text _stext : - { - /* Put reset handler first in .text section so it ends up as the entry */ - /* point of the program. */ - KEEP(*(.init)); - KEEP(*(.init.rust)); - . = ALIGN(4); - *(.trap); - *(.trap.rust); - *(.text.abort); - *(.text .text.*); - } > REGION_TEXT - - /* In-ILM code section */ - .fast : ALIGN(4) - { - _sifast = LOADADDR(.fast); - _sfast = .; - /** CAUTION: - ILM0 starts at 0x00000000. Using this as an IRQ handler address results in `None` when cast to `Option`. - The IRQ handler will not be called. - */ - KEEP(*(.vector_table.interrupts)); - *(.fast .fast.*); - . = ALIGN(4); - PROVIDE(_efast= .); /* No idea why `PROVIDE` is needed here */ - } > REGION_FASTTEXT AT > REGION_RODATA - - .rodata : ALIGN(4) - { - *(.srodata .srodata.*); - *(.rodata .rodata.*); - - /* 4-byte align the end (VMA) of this section. - This is required by LLD to ensure the LMA of the following .data - section will have the correct alignment. */ - . = ALIGN(4); - } > REGION_RODATA - - .data : ALIGN(4) - { - _sidata = LOADADDR(.data); - _sdata = .; - /* Must be called __global_pointer$ for linker relaxations to work. */ - PROVIDE(__global_pointer$ = . + 0x800); - *(.sdata .sdata.* .sdata2 .sdata2.*); - *(.data .data.*); - . = ALIGN(4); - _edata = .; - } > REGION_DATA AT > REGION_RODATA - - .bss (NOLOAD) : ALIGN(4) - { - _sbss = .; - *(.sbss .sbss.* .bss .bss.*); - . = ALIGN(4); - _ebss = .; - } > REGION_BSS - - /* fictitious region that represents the memory available for the heap */ - .heap (NOLOAD) : - { - _sheap = .; - . += _heap_size; - . = ALIGN(4); - _eheap = .; - } > REGION_HEAP - - /* fictitious region that represents the memory available for the stack */ - .stack (NOLOAD) : - { - _estack = .; - . = ABSOLUTE(_stack_start); - _sstack = .; - } > REGION_STACK - - /* fake output .got section */ - /* Dynamic relocations are unsupported. This section is only used to detect - relocatable code in the input files and raise an error if relocatable code - is found */ - .got (INFO) : - { - KEEP(*(.got .got.*)); - } - - /*.eh_frame (INFO) : { KEEP(*(.eh_frame)) } - .eh_frame_hdr (INFO) : { *(.eh_frame_hdr) }*/ - .eh_frame : { KEEP(*(.eh_frame)) } > REGION_TEXT - .eh_frame_hdr : { *(.eh_frame_hdr) } > REGION_TEXT -} - -/* Do not exceed this mark in the error messages above | */ -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_RODATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_RODATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_DATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_DATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_HEAP) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_HEAP must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_STACK) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_STACK must be 4-byte aligned"); - -ASSERT(_stext % 4 == 0, " -ERROR(riscv-rt): `_stext` must be 4-byte aligned"); - -ASSERT(_sdata % 4 == 0 && _edata % 4 == 0, " -BUG(riscv-rt): .data is not 4-byte aligned"); - -ASSERT(_sidata % 4 == 0, " -BUG(riscv-rt): the LMA of .data is not 4-byte aligned"); - -ASSERT(_sbss % 4 == 0 && _ebss % 4 == 0, " -BUG(riscv-rt): .bss is not 4-byte aligned"); - -ASSERT(_sheap % 4 == 0, " -BUG(riscv-rt): start of .heap is not 4-byte aligned"); - -ASSERT(_stext + SIZEOF(.text) < ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT), " -ERROR(riscv-rt): The .text section must be placed inside the REGION_TEXT region. -Set _stext to an address smaller than 'ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT)'"); - -ASSERT(SIZEOF(.stack) > (_max_hart_id + 1) * _hart_stack_size, " -ERROR(riscv-rt): .stack section is too small for allocating stacks for all the harts. -Consider changing `_max_hart_id` or `_hart_stack_size`."); - -ASSERT(SIZEOF(.got) == 0, " -.got section detected in the input files. Dynamic relocations are not -supported. If you are linking to C code compiled using the `gcc` crate -then modify your build script to compile the C code _without_ the --fPIC flag. See the documentation of the `gcc::Config.fpic` method for -details."); - -/* Do not exceed this mark in the error messages above | */ diff --git a/examples/hpm6200evk/memory-ram.x b/examples/hpm6200evk/memory-ram.x index 648ae17..46aff89 100644 --- a/examples/hpm6200evk/memory-ram.x +++ b/examples/hpm6200evk/memory-ram.x @@ -7,9 +7,13 @@ MEMORY AHB_SRAM : ORIGIN = 0xF0300000, LENGTH = 32K } REGION_ALIAS("REGION_TEXT", ILM0); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", ILM0); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); + + diff --git a/examples/hpm6200evk/memory-xip.x b/examples/hpm6200evk/memory-xip.x index f8c85c1..4c6e1d8 100644 --- a/examples/hpm6200evk/memory-xip.x +++ b/examples/hpm6200evk/memory-xip.x @@ -11,9 +11,12 @@ MEMORY } REGION_ALIAS("REGION_TEXT", XPI0_APP); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", XPI0_APP); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); + diff --git a/examples/hpm6200evk/memory.x b/examples/hpm6200evk/memory.x index f8c85c1..4c6e1d8 100644 --- a/examples/hpm6200evk/memory.x +++ b/examples/hpm6200evk/memory.x @@ -11,9 +11,12 @@ MEMORY } REGION_ALIAS("REGION_TEXT", XPI0_APP); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", XPI0_APP); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); + diff --git a/examples/hpm6300evk/.cargo/config.toml b/examples/hpm6300evk/.cargo/config.toml index 438723d..2b3e2fd 100644 --- a/examples/hpm6300evk/.cargo/config.toml +++ b/examples/hpm6300evk/.cargo/config.toml @@ -13,7 +13,7 @@ rustflags = [ "-C", "link-arg=-Tdevice.x", # __VECTORED_INTERRUPTS "-C", - "link-arg=-Tlink-fixed.x", + "link-arg=-Tlink.x", "-C", "link-arg=-Tdefmt.x", "-C", diff --git a/examples/hpm6300evk/Cargo.toml b/examples/hpm6300evk/Cargo.toml index 899698f..62e27b2 100644 --- a/examples/hpm6300evk/Cargo.toml +++ b/examples/hpm6300evk/Cargo.toml @@ -13,9 +13,8 @@ hpm-hal = { path = "../..", features = ["rt", "embassy", "hpm6360"] } defmt = "0.3.8" defmt-rtt = "0.4.1" embedded-hal = "1.0.0" -panic-halt = "0.2.0" +panic-halt = "1.0.0" riscv = { version = "0.11.1", features = ["critical-section-single-hart"] } -riscv-rt = { version = "0.12.2", features = ["single-hart"] } [profile.release] strip = false # symbols are not flashed to the microcontroller, so don't strip them. diff --git a/examples/hpm6300evk/link-fixed.x b/examples/hpm6300evk/link-fixed.x deleted file mode 100644 index d8b3813..0000000 --- a/examples/hpm6300evk/link-fixed.x +++ /dev/null @@ -1,229 +0,0 @@ -/* Temp fix for https://github.com/rust-embedded/riscv/issues/196 */ - -/* # Developer notes - -- Symbols that start with a double underscore (__) are considered "private" - -- Symbols that start with a single underscore (_) are considered "semi-public"; they can be - overridden in a user linker script, but should not be referred from user code (e.g. `extern "C" { - static mut _heap_size }`). - -- `EXTERN` forces the linker to keep a symbol in the final binary. We use this to make sure a - symbol if not dropped if it appears in or near the front of the linker arguments and "it's not - needed" by any of the preceding objects (linker arguments) - -- `PROVIDE` is used to provide default values that can be overridden by a user linker script - -- In this linker script, you may find symbols that look like `${...}` (e.g., `4`). - These are wildcards used by the `build.rs` script to adapt to different target particularities. - Check `build.rs` for more details about these symbols. - -- On alignment: it's important for correctness that the VMA boundaries of both .bss and .data *and* - the LMA of .data are all `4`-byte aligned. These alignments are assumed by the RAM - initialization routine. There's also a second benefit: `4`-byte aligned boundaries - means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`. -*/ - -PROVIDE(_stext = ORIGIN(REGION_TEXT)); -PROVIDE(_stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK)); -PROVIDE(_max_hart_id = 0); -PROVIDE(_hart_stack_size = 2K); -PROVIDE(_heap_size = 0); - -PROVIDE(InstructionMisaligned = ExceptionHandler); -PROVIDE(InstructionFault = ExceptionHandler); -PROVIDE(IllegalInstruction = ExceptionHandler); -PROVIDE(Breakpoint = ExceptionHandler); -PROVIDE(LoadMisaligned = ExceptionHandler); -PROVIDE(LoadFault = ExceptionHandler); -PROVIDE(StoreMisaligned = ExceptionHandler); -PROVIDE(StoreFault = ExceptionHandler);; -PROVIDE(UserEnvCall = ExceptionHandler); -PROVIDE(SupervisorEnvCall = ExceptionHandler); -PROVIDE(MachineEnvCall = ExceptionHandler); -PROVIDE(InstructionPageFault = ExceptionHandler); -PROVIDE(LoadPageFault = ExceptionHandler); -PROVIDE(StorePageFault = ExceptionHandler); - -PROVIDE(SupervisorSoft = DefaultHandler); -PROVIDE(MachineSoft = DefaultHandler); -PROVIDE(SupervisorTimer = DefaultHandler); -PROVIDE(MachineTimer = DefaultHandler); -PROVIDE(SupervisorExternal = DefaultHandler); -PROVIDE(MachineExternal = DefaultHandler); - -PROVIDE(DefaultHandler = DefaultInterruptHandler); -PROVIDE(ExceptionHandler = DefaultExceptionHandler); - -/* # Pre-initialization function */ -/* If the user overrides this using the `#[pre_init]` attribute or by creating a `__pre_init` function, - then the function this points to will be called before the RAM is initialized. */ -PROVIDE(__pre_init = default_pre_init); - -/* A PAC/HAL defined routine that should initialize custom interrupt controller if needed. */ -PROVIDE(_setup_interrupts = default_setup_interrupts); - -/* # Multi-processing hook function - fn _mp_hook() -> bool; - - This function is called from all the harts and must return true only for one hart, - which will perform memory initialization. For other harts it must return false - and implement wake-up in platform-dependent way (e.g. after waiting for a user interrupt). -*/ -PROVIDE(_mp_hook = default_mp_hook); - -/* # Start trap function override - By default uses the riscv crates default trap handler - but by providing the `_start_trap` symbol external crates can override. -*/ -PROVIDE(_start_trap = default_start_trap); - -SECTIONS -{ - .text.dummy (NOLOAD) : - { - /* This section is intended to make _stext address work */ - . = ABSOLUTE(_stext); - } > REGION_TEXT - - .text _stext : - { - /* Put reset handler first in .text section so it ends up as the entry */ - /* point of the program. */ - KEEP(*(.init)); - KEEP(*(.init.rust)); - . = ALIGN(4); - *(.trap); - *(.trap.rust); - *(.text.abort); - *(.text .text.*); - } > REGION_TEXT - - /* In-ILM code section */ - .fast : ALIGN(4) - { - _sifast = LOADADDR(.fast); - _sfast = .; - /** CAUTION: - ILM0 starts at 0x00000000. Using this as an IRQ handler address results in `None` when cast to `Option`. - The IRQ handler will not be called. - */ - KEEP(*(.vector_table.interrupts)); - *(.fast .fast.*); - . = ALIGN(4); - PROVIDE(_efast= .); /* No idea why `PROVIDE` is needed here */ - } > REGION_FASTTEXT AT > REGION_RODATA - - .rodata : ALIGN(4) - { - *(.srodata .srodata.*); - *(.rodata .rodata.*); - - /* 4-byte align the end (VMA) of this section. - This is required by LLD to ensure the LMA of the following .data - section will have the correct alignment. */ - . = ALIGN(4); - } > REGION_RODATA - - .data : ALIGN(4) - { - _sidata = LOADADDR(.data); - _sdata = .; - /* Must be called __global_pointer$ for linker relaxations to work. */ - PROVIDE(__global_pointer$ = . + 0x800); - *(.sdata .sdata.* .sdata2 .sdata2.*); - *(.data .data.*); - . = ALIGN(4); - _edata = .; - } > REGION_DATA AT > REGION_RODATA - - .bss (NOLOAD) : ALIGN(4) - { - _sbss = .; - *(.sbss .sbss.* .bss .bss.*); - . = ALIGN(4); - _ebss = .; - } > REGION_BSS - - /* fictitious region that represents the memory available for the heap */ - .heap (NOLOAD) : - { - _sheap = .; - . += _heap_size; - . = ALIGN(4); - _eheap = .; - } > REGION_HEAP - - /* fictitious region that represents the memory available for the stack */ - .stack (NOLOAD) : - { - _estack = .; - . = ABSOLUTE(_stack_start); - _sstack = .; - } > REGION_STACK - - /* fake output .got section */ - /* Dynamic relocations are unsupported. This section is only used to detect - relocatable code in the input files and raise an error if relocatable code - is found */ - .got (INFO) : - { - KEEP(*(.got .got.*)); - } - - /*.eh_frame (INFO) : { KEEP(*(.eh_frame)) } - .eh_frame_hdr (INFO) : { *(.eh_frame_hdr) }*/ - .eh_frame : { KEEP(*(.eh_frame)) } > REGION_TEXT - .eh_frame_hdr : { *(.eh_frame_hdr) } > REGION_TEXT -} - -/* Do not exceed this mark in the error messages above | */ -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_RODATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_RODATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_DATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_DATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_HEAP) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_HEAP must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_STACK) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_STACK must be 4-byte aligned"); - -ASSERT(_stext % 4 == 0, " -ERROR(riscv-rt): `_stext` must be 4-byte aligned"); - -ASSERT(_sdata % 4 == 0 && _edata % 4 == 0, " -BUG(riscv-rt): .data is not 4-byte aligned"); - -ASSERT(_sidata % 4 == 0, " -BUG(riscv-rt): the LMA of .data is not 4-byte aligned"); - -ASSERT(_sbss % 4 == 0 && _ebss % 4 == 0, " -BUG(riscv-rt): .bss is not 4-byte aligned"); - -ASSERT(_sheap % 4 == 0, " -BUG(riscv-rt): start of .heap is not 4-byte aligned"); - -ASSERT(_stext + SIZEOF(.text) < ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT), " -ERROR(riscv-rt): The .text section must be placed inside the REGION_TEXT region. -Set _stext to an address smaller than 'ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT)'"); - -ASSERT(SIZEOF(.stack) > (_max_hart_id + 1) * _hart_stack_size, " -ERROR(riscv-rt): .stack section is too small for allocating stacks for all the harts. -Consider changing `_max_hart_id` or `_hart_stack_size`."); - -ASSERT(SIZEOF(.got) == 0, " -.got section detected in the input files. Dynamic relocations are not -supported. If you are linking to C code compiled using the `gcc` crate -then modify your build script to compile the C code _without_ the --fPIC flag. See the documentation of the `gcc::Config.fpic` method for -details."); - -/* Do not exceed this mark in the error messages above | */ diff --git a/examples/hpm6300evk/memory-ram.x b/examples/hpm6300evk/memory-ram.x index f561415..41e9644 100644 --- a/examples/hpm6300evk/memory-ram.x +++ b/examples/hpm6300evk/memory-ram.x @@ -6,10 +6,13 @@ MEMORY AXI_SRAM : ORIGIN = 0x01200000, LENGTH = 512K AHB_SRAM : ORIGIN = 0xF0300000, LENGTH = 32K } + REGION_ALIAS("REGION_TEXT", ILM0); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", ILM0); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); diff --git a/examples/hpm6300evk/memory-xip.x b/examples/hpm6300evk/memory-xip.x index 095dd75..ef04f19 100644 --- a/examples/hpm6300evk/memory-xip.x +++ b/examples/hpm6300evk/memory-xip.x @@ -11,9 +11,11 @@ MEMORY } REGION_ALIAS("REGION_TEXT", XPI0_APP); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", XPI0_APP); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); diff --git a/examples/hpm6300evk/memory.x b/examples/hpm6300evk/memory.x index 59cf8b1..360a54a 100644 --- a/examples/hpm6300evk/memory.x +++ b/examples/hpm6300evk/memory.x @@ -11,9 +11,12 @@ MEMORY } REGION_ALIAS("REGION_TEXT", XPI0_APP); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", XPI0_APP); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); + diff --git a/examples/hpm6300evk/src/bin/raw_blinky.rs b/examples/hpm6300evk/src/bin/raw_blinky.rs index 26da13b..38aa531 100644 --- a/examples/hpm6300evk/src/bin/raw_blinky.rs +++ b/examples/hpm6300evk/src/bin/raw_blinky.rs @@ -10,7 +10,7 @@ use {defmt_rtt as _, panic_halt as _}; // defmt_rtt as _, -#[riscv_rt::entry] +#[hpm_hal::entry] fn main() -> ! { pac::PCFG.dcdc_mode().modify(|w| w.set_volt(1100)); diff --git a/examples/hpm6300evk/src/bin/rtt.rs b/examples/hpm6300evk/src/bin/rtt.rs index 305019e..e5cf052 100644 --- a/examples/hpm6300evk/src/bin/rtt.rs +++ b/examples/hpm6300evk/src/bin/rtt.rs @@ -8,7 +8,7 @@ use pac::gpiom::vals; use riscv::delay::McycleDelay; use {defmt_rtt as _, panic_halt as _}; -#[riscv_rt::entry] +#[hpm_hal::entry] fn main() -> ! { pac::PCFG.dcdc_mode().modify(|w| w.set_volt(1100)); diff --git a/examples/hpm6750evkmini/.cargo/config.toml b/examples/hpm6750evkmini/.cargo/config.toml index 95c1099..649142b 100644 --- a/examples/hpm6750evkmini/.cargo/config.toml +++ b/examples/hpm6750evkmini/.cargo/config.toml @@ -1,7 +1,27 @@ [build] -target = "riscv32imafc-unknown-none-elf" +# target = "riscv32imafc-unknown-none-elf" +target = "riscv32imafdcp-unknown-none-elf.json" -[target.riscv32imafc-unknown-none-elf] +[target.riscv32imafdcp-unknown-none-elf] +runner = 'riscv64-unknown-elf-gdb -x ./openocd-semihosting.gdb' +rustflags = [ + # Linker scripts: + "-C", + "link-arg=-Tmemory.x", + "-C", + "link-arg=-Tdevice.x", # __VECTORED_INTERRUPTS + "-C", + "link-arg=-Tlink.x", + "-C", + "link-arg=-Tdefmt.x", + "-C", + "link-arg=-nmagic", + + # "--emit", "obj", + # "--emit", "asm", +] + +[target.riscv32imac-unknown-none-elf] # Using modified openocd.gdb runner = 'riscv64-unknown-elf-gdb -x ./openocd-semihosting.gdb' # not available @@ -9,6 +29,8 @@ runner = 'riscv64-unknown-elf-gdb -x ./openocd-semihosting.gdb' rustflags = [ # +zba,+zbb,+zbc,+zbs are not available + "-C", + "target-feature=+f", # Linker scripts: "-C", "link-arg=-Tmemory.x", diff --git a/examples/hpm6750evkmini/Cargo.toml b/examples/hpm6750evkmini/Cargo.toml index 491be5f..4334cb3 100644 --- a/examples/hpm6750evkmini/Cargo.toml +++ b/examples/hpm6750evkmini/Cargo.toml @@ -15,12 +15,11 @@ embedded-hal = "1.0.0" hpm-hal = { path = "../..", features = ["rt", "embassy", "hpm6750", "chrono"] } -panic-halt = "0.2.0" +panic-halt = "1.0.0" riscv = { version = "0.11.1", features = ["critical-section-single-hart"] } -riscv-rt = { version = "0.12.2", features = ["single-hart"] } riscv-semihosting = "0.1.0" embassy-time = { version = "0.3.0", features = ["tick-hz-1_000_000"] } -embassy-executor = { version = "0.6.0", features = [ +embassy-executor = { version = "0.6.3", features = [ # "nightly", "integrated-timers", "arch-riscv32", diff --git a/examples/hpm6750evkmini/link-fixed.x b/examples/hpm6750evkmini/link-fixed.x deleted file mode 100644 index d8b3813..0000000 --- a/examples/hpm6750evkmini/link-fixed.x +++ /dev/null @@ -1,229 +0,0 @@ -/* Temp fix for https://github.com/rust-embedded/riscv/issues/196 */ - -/* # Developer notes - -- Symbols that start with a double underscore (__) are considered "private" - -- Symbols that start with a single underscore (_) are considered "semi-public"; they can be - overridden in a user linker script, but should not be referred from user code (e.g. `extern "C" { - static mut _heap_size }`). - -- `EXTERN` forces the linker to keep a symbol in the final binary. We use this to make sure a - symbol if not dropped if it appears in or near the front of the linker arguments and "it's not - needed" by any of the preceding objects (linker arguments) - -- `PROVIDE` is used to provide default values that can be overridden by a user linker script - -- In this linker script, you may find symbols that look like `${...}` (e.g., `4`). - These are wildcards used by the `build.rs` script to adapt to different target particularities. - Check `build.rs` for more details about these symbols. - -- On alignment: it's important for correctness that the VMA boundaries of both .bss and .data *and* - the LMA of .data are all `4`-byte aligned. These alignments are assumed by the RAM - initialization routine. There's also a second benefit: `4`-byte aligned boundaries - means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`. -*/ - -PROVIDE(_stext = ORIGIN(REGION_TEXT)); -PROVIDE(_stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK)); -PROVIDE(_max_hart_id = 0); -PROVIDE(_hart_stack_size = 2K); -PROVIDE(_heap_size = 0); - -PROVIDE(InstructionMisaligned = ExceptionHandler); -PROVIDE(InstructionFault = ExceptionHandler); -PROVIDE(IllegalInstruction = ExceptionHandler); -PROVIDE(Breakpoint = ExceptionHandler); -PROVIDE(LoadMisaligned = ExceptionHandler); -PROVIDE(LoadFault = ExceptionHandler); -PROVIDE(StoreMisaligned = ExceptionHandler); -PROVIDE(StoreFault = ExceptionHandler);; -PROVIDE(UserEnvCall = ExceptionHandler); -PROVIDE(SupervisorEnvCall = ExceptionHandler); -PROVIDE(MachineEnvCall = ExceptionHandler); -PROVIDE(InstructionPageFault = ExceptionHandler); -PROVIDE(LoadPageFault = ExceptionHandler); -PROVIDE(StorePageFault = ExceptionHandler); - -PROVIDE(SupervisorSoft = DefaultHandler); -PROVIDE(MachineSoft = DefaultHandler); -PROVIDE(SupervisorTimer = DefaultHandler); -PROVIDE(MachineTimer = DefaultHandler); -PROVIDE(SupervisorExternal = DefaultHandler); -PROVIDE(MachineExternal = DefaultHandler); - -PROVIDE(DefaultHandler = DefaultInterruptHandler); -PROVIDE(ExceptionHandler = DefaultExceptionHandler); - -/* # Pre-initialization function */ -/* If the user overrides this using the `#[pre_init]` attribute or by creating a `__pre_init` function, - then the function this points to will be called before the RAM is initialized. */ -PROVIDE(__pre_init = default_pre_init); - -/* A PAC/HAL defined routine that should initialize custom interrupt controller if needed. */ -PROVIDE(_setup_interrupts = default_setup_interrupts); - -/* # Multi-processing hook function - fn _mp_hook() -> bool; - - This function is called from all the harts and must return true only for one hart, - which will perform memory initialization. For other harts it must return false - and implement wake-up in platform-dependent way (e.g. after waiting for a user interrupt). -*/ -PROVIDE(_mp_hook = default_mp_hook); - -/* # Start trap function override - By default uses the riscv crates default trap handler - but by providing the `_start_trap` symbol external crates can override. -*/ -PROVIDE(_start_trap = default_start_trap); - -SECTIONS -{ - .text.dummy (NOLOAD) : - { - /* This section is intended to make _stext address work */ - . = ABSOLUTE(_stext); - } > REGION_TEXT - - .text _stext : - { - /* Put reset handler first in .text section so it ends up as the entry */ - /* point of the program. */ - KEEP(*(.init)); - KEEP(*(.init.rust)); - . = ALIGN(4); - *(.trap); - *(.trap.rust); - *(.text.abort); - *(.text .text.*); - } > REGION_TEXT - - /* In-ILM code section */ - .fast : ALIGN(4) - { - _sifast = LOADADDR(.fast); - _sfast = .; - /** CAUTION: - ILM0 starts at 0x00000000. Using this as an IRQ handler address results in `None` when cast to `Option`. - The IRQ handler will not be called. - */ - KEEP(*(.vector_table.interrupts)); - *(.fast .fast.*); - . = ALIGN(4); - PROVIDE(_efast= .); /* No idea why `PROVIDE` is needed here */ - } > REGION_FASTTEXT AT > REGION_RODATA - - .rodata : ALIGN(4) - { - *(.srodata .srodata.*); - *(.rodata .rodata.*); - - /* 4-byte align the end (VMA) of this section. - This is required by LLD to ensure the LMA of the following .data - section will have the correct alignment. */ - . = ALIGN(4); - } > REGION_RODATA - - .data : ALIGN(4) - { - _sidata = LOADADDR(.data); - _sdata = .; - /* Must be called __global_pointer$ for linker relaxations to work. */ - PROVIDE(__global_pointer$ = . + 0x800); - *(.sdata .sdata.* .sdata2 .sdata2.*); - *(.data .data.*); - . = ALIGN(4); - _edata = .; - } > REGION_DATA AT > REGION_RODATA - - .bss (NOLOAD) : ALIGN(4) - { - _sbss = .; - *(.sbss .sbss.* .bss .bss.*); - . = ALIGN(4); - _ebss = .; - } > REGION_BSS - - /* fictitious region that represents the memory available for the heap */ - .heap (NOLOAD) : - { - _sheap = .; - . += _heap_size; - . = ALIGN(4); - _eheap = .; - } > REGION_HEAP - - /* fictitious region that represents the memory available for the stack */ - .stack (NOLOAD) : - { - _estack = .; - . = ABSOLUTE(_stack_start); - _sstack = .; - } > REGION_STACK - - /* fake output .got section */ - /* Dynamic relocations are unsupported. This section is only used to detect - relocatable code in the input files and raise an error if relocatable code - is found */ - .got (INFO) : - { - KEEP(*(.got .got.*)); - } - - /*.eh_frame (INFO) : { KEEP(*(.eh_frame)) } - .eh_frame_hdr (INFO) : { *(.eh_frame_hdr) }*/ - .eh_frame : { KEEP(*(.eh_frame)) } > REGION_TEXT - .eh_frame_hdr : { *(.eh_frame_hdr) } > REGION_TEXT -} - -/* Do not exceed this mark in the error messages above | */ -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_RODATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_RODATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_DATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_DATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_HEAP) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_HEAP must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_STACK) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_STACK must be 4-byte aligned"); - -ASSERT(_stext % 4 == 0, " -ERROR(riscv-rt): `_stext` must be 4-byte aligned"); - -ASSERT(_sdata % 4 == 0 && _edata % 4 == 0, " -BUG(riscv-rt): .data is not 4-byte aligned"); - -ASSERT(_sidata % 4 == 0, " -BUG(riscv-rt): the LMA of .data is not 4-byte aligned"); - -ASSERT(_sbss % 4 == 0 && _ebss % 4 == 0, " -BUG(riscv-rt): .bss is not 4-byte aligned"); - -ASSERT(_sheap % 4 == 0, " -BUG(riscv-rt): start of .heap is not 4-byte aligned"); - -ASSERT(_stext + SIZEOF(.text) < ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT), " -ERROR(riscv-rt): The .text section must be placed inside the REGION_TEXT region. -Set _stext to an address smaller than 'ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT)'"); - -ASSERT(SIZEOF(.stack) > (_max_hart_id + 1) * _hart_stack_size, " -ERROR(riscv-rt): .stack section is too small for allocating stacks for all the harts. -Consider changing `_max_hart_id` or `_hart_stack_size`."); - -ASSERT(SIZEOF(.got) == 0, " -.got section detected in the input files. Dynamic relocations are not -supported. If you are linking to C code compiled using the `gcc` crate -then modify your build script to compile the C code _without_ the --fPIC flag. See the documentation of the `gcc::Config.fpic` method for -details."); - -/* Do not exceed this mark in the error messages above | */ diff --git a/examples/hpm6750evkmini/memory.x b/examples/hpm6750evkmini/memory.x index cf1d051..7a8c90d 100644 --- a/examples/hpm6750evkmini/memory.x +++ b/examples/hpm6750evkmini/memory.x @@ -14,10 +14,12 @@ MEMORY SDRAM : ORIGIN = 0x40000000, LENGTH = 32M } -REGION_ALIAS("REGION_TEXT", ILM0); -REGION_ALIAS("REGION_RODATA", ILM0); +REGION_ALIAS("REGION_TEXT", XPI0_APP); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); +REGION_ALIAS("REGION_RODATA", XPI0_APP); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); diff --git a/examples/hpm6750evkmini/openocd-semihosting.gdb b/examples/hpm6750evkmini/openocd-semihosting.gdb index 5a9a570..9be7fbc 100644 --- a/examples/hpm6750evkmini/openocd-semihosting.gdb +++ b/examples/hpm6750evkmini/openocd-semihosting.gdb @@ -17,4 +17,4 @@ monitor arm semihosting enable load continue -quit +# quit diff --git a/examples/hpm6750evkmini/riscv32imafdcp-unknown-none-elf.json b/examples/hpm6750evkmini/riscv32imafdcp-unknown-none-elf.json new file mode 100644 index 0000000..04e8cc7 --- /dev/null +++ b/examples/hpm6750evkmini/riscv32imafdcp-unknown-none-elf.json @@ -0,0 +1,24 @@ +{ + "arch": "riscv32", + "cpu": "generic-rv32", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "eh-frame-header": false, + "emit-debug-gdb-scripts": false, + "features": "+m,+a,+c,+f,+d", + "is-builtin": false, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "ilp32f", + "llvm-target": "riscv32", + "max-atomic-width": 32, + "metadata": { + "description": "Bare RISC-V (RV32IMAFC ISA)", + "host_tools": false, + "std": false, + "tier": 2 + }, + "panic-strategy": "abort", + "relocation-model": "static", + "target-pointer-width": "32" +} diff --git a/examples/hpm6750evkmini/src/bin/raw_blinky.rs b/examples/hpm6750evkmini/src/bin/raw_blinky.rs index 1761ae4..aee7f32 100644 --- a/examples/hpm6750evkmini/src/bin/raw_blinky.rs +++ b/examples/hpm6750evkmini/src/bin/raw_blinky.rs @@ -8,7 +8,7 @@ use pac::gpiom::vals; use riscv::delay::McycleDelay; use {defmt_rtt as _, panic_halt as _}; -#[riscv_rt::entry] +#[hpm_hal::entry] fn main() -> ! { pac::PCFG.dcdc_mode().modify(|w| w.set_volt(1100)); diff --git a/examples/hpm6750evkmini/src/bin/raw_pwm.rs b/examples/hpm6750evkmini/src/bin/raw_pwm.rs index b0edb76..5a16006 100644 --- a/examples/hpm6750evkmini/src/bin/raw_pwm.rs +++ b/examples/hpm6750evkmini/src/bin/raw_pwm.rs @@ -3,6 +3,8 @@ #![feature(type_alias_impl_trait)] #![feature(impl_trait_in_assoc_type)] +use core::ptr::addr_of_mut; + use assign_resources::assign_resources; use embassy_time::Delay; use embedded_hal::delay::DelayNs; @@ -17,14 +19,15 @@ use {defmt_rtt as _, hpm_hal as hal}; const BOARD_NAME: &str = "HPM5300EVK"; const BANNER: &str = include_str!("../../../assets/BANNER"); +static mut UART: Option> = None; + macro_rules! println { ($($arg:tt)*) => { - let _ = writeln!(unsafe {UART.as_mut().unwrap()}, $($arg)*); + let uart = unsafe { (&mut *(&raw mut UART)).as_mut().unwrap()}; + let _ = writeln!(uart , $($arg)*); }; } -static mut UART: Option> = None; - assign_resources! { leds: Led { r: PB19, // PWM1, CH0 diff --git a/examples/hpm6750evkmini/src/bin/semihosting.rs b/examples/hpm6750evkmini/src/bin/semihosting.rs index ee69431..63dbf46 100644 --- a/examples/hpm6750evkmini/src/bin/semihosting.rs +++ b/examples/hpm6750evkmini/src/bin/semihosting.rs @@ -5,12 +5,10 @@ use core::fmt::Write as _; use embedded_hal::delay::DelayNs; use hal::pac; -// use hpm_metapac as pac, -use hpm_hal as hal; use pac::gpiom::vals; use riscv::delay::McycleDelay; use riscv_semihosting::{dbg, hio}; -use {defmt_rtt as _, panic_halt as _}; +use {defmt_rtt as _, hpm_hal as hal, panic_halt as _}; macro_rules! println { ($($arg:tt)*) => { @@ -23,7 +21,7 @@ macro_rules! println { static mut STDOUT: Option = None; -#[riscv_rt::entry] +#[hpm_hal::entry] fn main() -> ! { let stdout = hio::hstdout().map_err(|_| core::fmt::Error).unwrap(); unsafe { STDOUT = Some(stdout) }; diff --git a/examples/hpm6750evkmini/src/bin/spi_st7789.rs b/examples/hpm6750evkmini/src/bin/spi_st7789.rs index b039050..34b8b9f 100644 --- a/examples/hpm6750evkmini/src/bin/spi_st7789.rs +++ b/examples/hpm6750evkmini/src/bin/spi_st7789.rs @@ -22,7 +22,7 @@ use hpm_hal::mode::Blocking; use hpm_hal::spi::{Config, Spi}; use hpm_hal::time::Hertz; use riscv::delay::McycleDelay; -use {defmt_rtt as _, hpm_hal as hal, panic_halt as _, riscv_rt as _}; +use {defmt_rtt as _, hpm_hal as hal, panic_halt as _}; pub struct ST7789< Spi: SpiDevice, diff --git a/examples/hpm6750evkmini/src/bin/uart_async.rs b/examples/hpm6750evkmini/src/bin/uart_async.rs index 5a14421..46e8ea4 100644 --- a/examples/hpm6750evkmini/src/bin/uart_async.rs +++ b/examples/hpm6750evkmini/src/bin/uart_async.rs @@ -57,7 +57,7 @@ async fn main(spawner: Spawner) -> ! { writeln!(uart, "Hello DMA => {:08x}\r\n", hal::pac::HDMA.int_status().read().0).unwrap(); uart.write(b"Hello Async World!\r\n").await.unwrap(); - uart.write(b"Type something: ").await.unwrap(); + uart.write(b"Type something(4 byte buf): ").await.unwrap(); let mut buf = [0u8; 4]; diff --git a/examples/hpm6750evkmini/src/bin/usb.rs b/examples/hpm6750evkmini/src/bin/usb.rs index 91b32fc..5d96c2e 100644 --- a/examples/hpm6750evkmini/src/bin/usb.rs +++ b/examples/hpm6750evkmini/src/bin/usb.rs @@ -12,7 +12,7 @@ use embassy_usb::Builder; use futures_util::future::join; use hal::usb::{Instance, UsbDriver}; use hpm_hal::{bind_interrupts, peripherals}; -use {defmt_rtt as _, hpm_hal as hal, riscv_rt as _}; +use {defmt_rtt as _, hpm_hal as hal}; bind_interrupts!(struct Irqs { USB0 => hal::usb::InterruptHandler; diff --git a/examples/hpm6750evkmini/src/lib.rs b/examples/hpm6750evkmini/src/lib.rs index 0c9ac1a..b08d001 100644 --- a/examples/hpm6750evkmini/src/lib.rs +++ b/examples/hpm6750evkmini/src/lib.rs @@ -1 +1,177 @@ #![no_std] + +use hal::pac; +use hpm_hal as hal; + +fn init_femc_pins() { + use pac::iomux::*; + use pac::pins::*; + use pac::IOC; + + IOC.pad(PD13) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD13_FUNC_CTL_FEMC_DQ_14)); + IOC.pad(PD12) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD12_FUNC_CTL_FEMC_DQ_15)); + IOC.pad(PD10) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD10_FUNC_CTL_FEMC_DQ_12)); + IOC.pad(PD09) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD09_FUNC_CTL_FEMC_DQ_13)); + IOC.pad(PD08) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD08_FUNC_CTL_FEMC_DQ_00)); + IOC.pad(PD07) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD07_FUNC_CTL_FEMC_DQ_10)); + IOC.pad(PD06) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD06_FUNC_CTL_FEMC_DQ_11)); + IOC.pad(PD05) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD05_FUNC_CTL_FEMC_DQ_01)); + IOC.pad(PD04) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD04_FUNC_CTL_FEMC_DQ_08)); + IOC.pad(PD03) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD03_FUNC_CTL_FEMC_DQ_09)); + IOC.pad(PD02) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD02_FUNC_CTL_FEMC_DQ_04)); + IOC.pad(PD01) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD01_FUNC_CTL_FEMC_DQ_03)); + IOC.pad(PD00) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PD00_FUNC_CTL_FEMC_DQ_02)); + IOC.pad(PC29) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC29_FUNC_CTL_FEMC_DQ_07)); + IOC.pad(PC28) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC28_FUNC_CTL_FEMC_DQ_06)); + IOC.pad(PC27) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC27_FUNC_CTL_FEMC_DQ_05)); + + IOC.pad(PC21) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC21_FUNC_CTL_FEMC_A_11)); + IOC.pad(PC17) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC17_FUNC_CTL_FEMC_A_09)); + IOC.pad(PC15) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC15_FUNC_CTL_FEMC_A_10)); + IOC.pad(PC12) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC12_FUNC_CTL_FEMC_A_08)); + IOC.pad(PC11) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC11_FUNC_CTL_FEMC_A_07)); + IOC.pad(PC10) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC10_FUNC_CTL_FEMC_A_06)); + IOC.pad(PC09) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC09_FUNC_CTL_FEMC_A_01)); + IOC.pad(PC08) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC08_FUNC_CTL_FEMC_A_00)); + IOC.pad(PC07) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC07_FUNC_CTL_FEMC_A_05)); + IOC.pad(PC06) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC06_FUNC_CTL_FEMC_A_04)); + IOC.pad(PC05) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC05_FUNC_CTL_FEMC_A_03)); + IOC.pad(PC04) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC04_FUNC_CTL_FEMC_A_02)); + + IOC.pad(PC14) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC14_FUNC_CTL_FEMC_BA1)); + IOC.pad(PC13) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC13_FUNC_CTL_FEMC_BA0)); + IOC.pad(PC16).func_ctl().write(|w| { + w.set_alt_select(IOC_PC16_FUNC_CTL_FEMC_DQS); + w.set_loop_back(true); + }); + IOC.pad(PC26) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC26_FUNC_CTL_FEMC_CLK)); + IOC.pad(PC25) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC25_FUNC_CTL_FEMC_CKE)); + IOC.pad(PC19) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC19_FUNC_CTL_FEMC_CS_0)); + IOC.pad(PC18) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC18_FUNC_CTL_FEMC_RAS)); + IOC.pad(PC23) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC23_FUNC_CTL_FEMC_CAS)); + IOC.pad(PC24) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC24_FUNC_CTL_FEMC_WE)); + IOC.pad(PC30) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC30_FUNC_CTL_FEMC_DM_0)); + IOC.pad(PC31) + .func_ctl() + .write(|w| w.set_alt_select(IOC_PC31_FUNC_CTL_FEMC_DM_1)); +} + +pub fn init_ext_ram() { + use hal::femc::*; + + init_femc_pins(); + + let clk_in = hal::sysctl::clocks().get_clock_freq(pac::clocks::FEMC); + + let femc_config = FemcConfig::default(); + let mut femc = unsafe { Femc::new_raw(hal::peripherals::FEMC::steal()) }; + + femc.init(femc_config); + + let mut sdram_config = FemcSdramConfig::default(); + + sdram_config.bank_num = Bank2Sel::BANK_NUM_4; + sdram_config.prescaler = 0x3; + sdram_config.burst_len = BurstLen::_8; + sdram_config.auto_refresh_count_in_one_burst = 1; + // Column address: A0-A8 + sdram_config.col_addr_bits = ColAddrBits::_9BIT; + sdram_config.cas_latency = CasLatency::_3; + + // AC Characteristics and Operating Condition + sdram_config.refresh_to_refresh_in_ns = 60; /* Trc */ + sdram_config.refresh_recover_in_ns = 60; /* Trc */ + sdram_config.act_to_precharge_in_ns = 42; /* Tras */ + sdram_config.act_to_rw_in_ns = 18; /* Trcd */ + sdram_config.precharge_to_act_in_ns = 18; /* Trp */ + sdram_config.act_to_act_in_ns = 12; /* Trrd */ + sdram_config.write_recover_in_ns = 12; /* Twr/Tdpl */ + sdram_config.self_refresh_recover_in_ns = 72; /* Txsr */ + + sdram_config.cs = 0; // BOARD_SDRAM_CS; = FEMC_SDRAM_CS0 = 0 + sdram_config.base_address = 0x40000000; // BOARD_SDRAM_ADDRESS; + sdram_config.size = MemorySize::_16MB; + sdram_config.port_size = SdramPortSize::_16BIT; + sdram_config.refresh_count = 4096; // BOARD_SDRAM_REFRESH_COUNT; + sdram_config.refresh_in_ms = 64; // Tref, BOARD_SDRAM_REFRESH_IN_MS; + + sdram_config.delay_cell_disable = true; + sdram_config.delay_cell_value = 0; + + let _ = femc.configure_sdram(clk_in.0, sdram_config).unwrap(); + // pac::FEMC.sdrctrl0().modify(|w| w.set_highband(true)); +} diff --git a/examples/hpm6e00evk/.cargo/config.toml b/examples/hpm6e00evk/.cargo/config.toml index fa83e93..772e7e5 100644 --- a/examples/hpm6e00evk/.cargo/config.toml +++ b/examples/hpm6e00evk/.cargo/config.toml @@ -16,7 +16,7 @@ rustflags = [ "-C", "link-arg=-Tdevice.x", # __VECTORED_INTERRUPTS "-C", - "link-arg=-Tlink-fixed.x", + "link-arg=-Tlink.x", "-C", "link-arg=-Tdefmt.x", "-C", diff --git a/examples/hpm6e00evk/Cargo.toml b/examples/hpm6e00evk/Cargo.toml index 2edfcbf..e6da3f0 100644 --- a/examples/hpm6e00evk/Cargo.toml +++ b/examples/hpm6e00evk/Cargo.toml @@ -7,7 +7,7 @@ resolver = "2" [dependencies] hpm-hal = { path = "../../", features = ["hpm6e80", "rt", "embassy"] } -panic-halt = "0.2.0" +panic-halt = "1.0.0" defmt = "0.3.8" defmt-rtt = "0.4.1" @@ -16,8 +16,8 @@ riscv = { version = "0.11.1", features = ["critical-section-single-hart"] } heapless = "0.8.0" embassy-time = { version = "0.3.0", features = ["tick-hz-1_000_000"] } -embassy-executor = { version = "0.6.0", features = [ - "nightly", +embassy-executor = { version = "0.6.3", features = [ + # "nightly", "integrated-timers", "arch-riscv32", "executor-thread", @@ -33,21 +33,10 @@ futures-util = { version = "0.3", default-features = false } tinygif = "0.0.4" assign-resources = "0.4.1" embedded-hal-bus = "0.2.0" -embassy-sync = "0.6.0" +embassy-sync = "0.6.1" usbd-hid = "0.8" static_cell = "2" -edrv-bh1750 = { path = "../../../../embedded-drivers/bh1750" } -edrv-bme280 = { path = "../../../../embedded-drivers/bme280" } -edrv-bmp180 = { path = "../../../../embedded-drivers/bmp180" } -edrv-bme680 = { path = "../../../../embedded-drivers/bme680" } - -edrv-mpu6050 = { path = "../../../../embedded-drivers/mpu6050" } -edrv-apds9930 = { path = "../../../../embedded-drivers/apds9930" } - -edrv-ltr390uv = { path = "../../../../embedded-drivers/ltr390uv" } - -edrv-spl06 = { path = "../../../../embedded-drivers/spl06" } [profile.release] strip = false # symbols are not flashed to the microcontroller, so don't strip them. diff --git a/examples/hpm6e00evk/link-fixed.x b/examples/hpm6e00evk/link-fixed.x deleted file mode 100644 index d8b3813..0000000 --- a/examples/hpm6e00evk/link-fixed.x +++ /dev/null @@ -1,229 +0,0 @@ -/* Temp fix for https://github.com/rust-embedded/riscv/issues/196 */ - -/* # Developer notes - -- Symbols that start with a double underscore (__) are considered "private" - -- Symbols that start with a single underscore (_) are considered "semi-public"; they can be - overridden in a user linker script, but should not be referred from user code (e.g. `extern "C" { - static mut _heap_size }`). - -- `EXTERN` forces the linker to keep a symbol in the final binary. We use this to make sure a - symbol if not dropped if it appears in or near the front of the linker arguments and "it's not - needed" by any of the preceding objects (linker arguments) - -- `PROVIDE` is used to provide default values that can be overridden by a user linker script - -- In this linker script, you may find symbols that look like `${...}` (e.g., `4`). - These are wildcards used by the `build.rs` script to adapt to different target particularities. - Check `build.rs` for more details about these symbols. - -- On alignment: it's important for correctness that the VMA boundaries of both .bss and .data *and* - the LMA of .data are all `4`-byte aligned. These alignments are assumed by the RAM - initialization routine. There's also a second benefit: `4`-byte aligned boundaries - means that you won't see "Address (..) is out of bounds" in the disassembly produced by `objdump`. -*/ - -PROVIDE(_stext = ORIGIN(REGION_TEXT)); -PROVIDE(_stack_start = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK)); -PROVIDE(_max_hart_id = 0); -PROVIDE(_hart_stack_size = 2K); -PROVIDE(_heap_size = 0); - -PROVIDE(InstructionMisaligned = ExceptionHandler); -PROVIDE(InstructionFault = ExceptionHandler); -PROVIDE(IllegalInstruction = ExceptionHandler); -PROVIDE(Breakpoint = ExceptionHandler); -PROVIDE(LoadMisaligned = ExceptionHandler); -PROVIDE(LoadFault = ExceptionHandler); -PROVIDE(StoreMisaligned = ExceptionHandler); -PROVIDE(StoreFault = ExceptionHandler);; -PROVIDE(UserEnvCall = ExceptionHandler); -PROVIDE(SupervisorEnvCall = ExceptionHandler); -PROVIDE(MachineEnvCall = ExceptionHandler); -PROVIDE(InstructionPageFault = ExceptionHandler); -PROVIDE(LoadPageFault = ExceptionHandler); -PROVIDE(StorePageFault = ExceptionHandler); - -PROVIDE(SupervisorSoft = DefaultHandler); -PROVIDE(MachineSoft = DefaultHandler); -PROVIDE(SupervisorTimer = DefaultHandler); -PROVIDE(MachineTimer = DefaultHandler); -PROVIDE(SupervisorExternal = DefaultHandler); -PROVIDE(MachineExternal = DefaultHandler); - -PROVIDE(DefaultHandler = DefaultInterruptHandler); -PROVIDE(ExceptionHandler = DefaultExceptionHandler); - -/* # Pre-initialization function */ -/* If the user overrides this using the `#[pre_init]` attribute or by creating a `__pre_init` function, - then the function this points to will be called before the RAM is initialized. */ -PROVIDE(__pre_init = default_pre_init); - -/* A PAC/HAL defined routine that should initialize custom interrupt controller if needed. */ -PROVIDE(_setup_interrupts = default_setup_interrupts); - -/* # Multi-processing hook function - fn _mp_hook() -> bool; - - This function is called from all the harts and must return true only for one hart, - which will perform memory initialization. For other harts it must return false - and implement wake-up in platform-dependent way (e.g. after waiting for a user interrupt). -*/ -PROVIDE(_mp_hook = default_mp_hook); - -/* # Start trap function override - By default uses the riscv crates default trap handler - but by providing the `_start_trap` symbol external crates can override. -*/ -PROVIDE(_start_trap = default_start_trap); - -SECTIONS -{ - .text.dummy (NOLOAD) : - { - /* This section is intended to make _stext address work */ - . = ABSOLUTE(_stext); - } > REGION_TEXT - - .text _stext : - { - /* Put reset handler first in .text section so it ends up as the entry */ - /* point of the program. */ - KEEP(*(.init)); - KEEP(*(.init.rust)); - . = ALIGN(4); - *(.trap); - *(.trap.rust); - *(.text.abort); - *(.text .text.*); - } > REGION_TEXT - - /* In-ILM code section */ - .fast : ALIGN(4) - { - _sifast = LOADADDR(.fast); - _sfast = .; - /** CAUTION: - ILM0 starts at 0x00000000. Using this as an IRQ handler address results in `None` when cast to `Option`. - The IRQ handler will not be called. - */ - KEEP(*(.vector_table.interrupts)); - *(.fast .fast.*); - . = ALIGN(4); - PROVIDE(_efast= .); /* No idea why `PROVIDE` is needed here */ - } > REGION_FASTTEXT AT > REGION_RODATA - - .rodata : ALIGN(4) - { - *(.srodata .srodata.*); - *(.rodata .rodata.*); - - /* 4-byte align the end (VMA) of this section. - This is required by LLD to ensure the LMA of the following .data - section will have the correct alignment. */ - . = ALIGN(4); - } > REGION_RODATA - - .data : ALIGN(4) - { - _sidata = LOADADDR(.data); - _sdata = .; - /* Must be called __global_pointer$ for linker relaxations to work. */ - PROVIDE(__global_pointer$ = . + 0x800); - *(.sdata .sdata.* .sdata2 .sdata2.*); - *(.data .data.*); - . = ALIGN(4); - _edata = .; - } > REGION_DATA AT > REGION_RODATA - - .bss (NOLOAD) : ALIGN(4) - { - _sbss = .; - *(.sbss .sbss.* .bss .bss.*); - . = ALIGN(4); - _ebss = .; - } > REGION_BSS - - /* fictitious region that represents the memory available for the heap */ - .heap (NOLOAD) : - { - _sheap = .; - . += _heap_size; - . = ALIGN(4); - _eheap = .; - } > REGION_HEAP - - /* fictitious region that represents the memory available for the stack */ - .stack (NOLOAD) : - { - _estack = .; - . = ABSOLUTE(_stack_start); - _sstack = .; - } > REGION_STACK - - /* fake output .got section */ - /* Dynamic relocations are unsupported. This section is only used to detect - relocatable code in the input files and raise an error if relocatable code - is found */ - .got (INFO) : - { - KEEP(*(.got .got.*)); - } - - /*.eh_frame (INFO) : { KEEP(*(.eh_frame)) } - .eh_frame_hdr (INFO) : { *(.eh_frame_hdr) }*/ - .eh_frame : { KEEP(*(.eh_frame)) } > REGION_TEXT - .eh_frame_hdr : { *(.eh_frame_hdr) } > REGION_TEXT -} - -/* Do not exceed this mark in the error messages above | */ -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_RODATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_RODATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_DATA) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_DATA must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_HEAP) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_HEAP must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_TEXT) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_TEXT must be 4-byte aligned"); - -ASSERT(ORIGIN(REGION_STACK) % 4 == 0, " -ERROR(riscv-rt): the start of the REGION_STACK must be 4-byte aligned"); - -ASSERT(_stext % 4 == 0, " -ERROR(riscv-rt): `_stext` must be 4-byte aligned"); - -ASSERT(_sdata % 4 == 0 && _edata % 4 == 0, " -BUG(riscv-rt): .data is not 4-byte aligned"); - -ASSERT(_sidata % 4 == 0, " -BUG(riscv-rt): the LMA of .data is not 4-byte aligned"); - -ASSERT(_sbss % 4 == 0 && _ebss % 4 == 0, " -BUG(riscv-rt): .bss is not 4-byte aligned"); - -ASSERT(_sheap % 4 == 0, " -BUG(riscv-rt): start of .heap is not 4-byte aligned"); - -ASSERT(_stext + SIZEOF(.text) < ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT), " -ERROR(riscv-rt): The .text section must be placed inside the REGION_TEXT region. -Set _stext to an address smaller than 'ORIGIN(REGION_TEXT) + LENGTH(REGION_TEXT)'"); - -ASSERT(SIZEOF(.stack) > (_max_hart_id + 1) * _hart_stack_size, " -ERROR(riscv-rt): .stack section is too small for allocating stacks for all the harts. -Consider changing `_max_hart_id` or `_hart_stack_size`."); - -ASSERT(SIZEOF(.got) == 0, " -.got section detected in the input files. Dynamic relocations are not -supported. If you are linking to C code compiled using the `gcc` crate -then modify your build script to compile the C code _without_ the --fPIC flag. See the documentation of the `gcc::Config.fpic` method for -details."); - -/* Do not exceed this mark in the error messages above | */ diff --git a/examples/hpm6e00evk/memory.x b/examples/hpm6e00evk/memory.x index a45ae11..2511d1d 100644 --- a/examples/hpm6e00evk/memory.x +++ b/examples/hpm6e00evk/memory.x @@ -9,9 +9,12 @@ MEMORY } REGION_ALIAS("REGION_TEXT", XPI0_APP); +REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_FASTDATA", DLM0); REGION_ALIAS("REGION_RODATA", XPI0_APP); REGION_ALIAS("REGION_DATA", DLM0); -REGION_ALIAS("REGION_BSS", DLM0) +REGION_ALIAS("REGION_BSS", DLM0); REGION_ALIAS("REGION_HEAP", DLM0); REGION_ALIAS("REGION_STACK", DLM0); -REGION_ALIAS("REGION_FASTTEXT", ILM0); +REGION_ALIAS("REGION_NONCACHEABLE_RAM", AXI_SRAM); + diff --git a/src/sysctl/v68.rs b/src/sysctl/v68.rs index 4a1e620..24bc02e 100644 --- a/src/sysctl/v68.rs +++ b/src/sysctl/v68.rs @@ -170,7 +170,6 @@ pub(crate) unsafe fn init(config: Config) { // TODO: PLL setting let pll2 = output_freq_of_pll(2); - defmt::debug!("PLL2: {}", pll2); SYSCTL.clock(pac::clocks::CPU0).modify(|w| { w.set_mux(config.cpu0.src); diff --git a/src/sysctl/v6e.rs b/src/sysctl/v6e.rs index 338b007..4bdcf03 100644 --- a/src/sysctl/v6e.rs +++ b/src/sysctl/v6e.rs @@ -188,7 +188,6 @@ pub(crate) unsafe fn init(config: Config) { // TODO: PLL setting let pll2 = output_freq_of_pll(2); - defmt::debug!("PLL2: {}", pll2); SYSCTL.clock(pac::clocks::CPU0).modify(|w| { w.set_mux(config.cpu0.src);