Repository navigation
control: add PSoC Control variant #30
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
base: control-main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # | ||
| # Copyright (c) Arduino s.r.l. and/or its affiliated companies | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
|
|
||
| # Keep the board defaults and only add the minimum Arduino-required features. | ||
| CONFIG_ARM_MPU=y | ||
| # CONFIG_HW_STACK_PROTECTION=y | ||
| CONFIG_TRUSTED_EXECUTION_SECURE=y | ||
| CONFIG_ARM_TRUSTZONE_M=y | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 10 and 11,(CONFIG_TRUSTED_EXECUTION_SECURE=y |
||
|
|
||
| # This board only exposes 64KB of secure RAM. The loader's default | ||
| # heap/stack sizes (32KB each) alone consume all of it, overflowing | ||
| # RAM. Shrink them to fit. | ||
| CONFIG_MAIN_STACK_SIZE=4096 | ||
| CONFIG_HEAP_MEM_POOL_SIZE=16384 | ||
| CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1024 | ||
|
|
||
| # Default LLEXT heap (32KB) plus the above still leaves almost no headroom | ||
| # for the kernel/drivers on this 64KB chip, corrupting RAM at boot. Shrink | ||
| # it too; small sketches don't need a large extension heap. | ||
| CONFIG_LLEXT_HEAP_SIZE=16 | ||
|
|
||
| CONFIG_LLEXT_STORAGE_WRITABLE=n | ||
|
|
||
| CONFIG_GPIO=y | ||
| CONFIG_CLOCK_CONTROL=y | ||
| CONFIG_CONSOLE=y | ||
| CONFIG_UART_CONSOLE=y | ||
| CONFIG_SERIAL=y | ||
| CONFIG_CAN=y | ||
|
|
||
| # The board's QSPI/flash controller is not provided by the current Zephyr tree | ||
| # in a way that exposes the flash_map APIs required by the Arduino loader. | ||
| # Disable this so the loader build does not reference missing symbols. | ||
| CONFIG_FLASH=n | ||
| CONFIG_FLASH_MAP=n | ||
|
Comment on lines
+37
to
+38
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also duplicated again 47, 48 |
||
|
|
||
| CONFIG_SHARED_INTERRUPTS=y | ||
|
|
||
| CONFIG_BOOT_BANNER=n | ||
|
|
||
| CONFIG_ARM_MPU=n | ||
| CONFIG_HW_STACK_PROTECTION=n | ||
|
|
||
| CONFIG_FLASH=n | ||
| CONFIG_FLASH_MAP=n | ||
|
|
||
| CONFIG_BUILD_OUTPUT_BIN=n | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you reconsider CONFIG_BUILD_OUTPUT_BIN=n here? |
||
|
|
||
| CONFIG_BOOTLOADER_MCUBOOT=n | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Copyright (c) Arduino s.r.l. and/or its affiliated companies | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /* | ||
| * Minimal Arduino overlay for the Infineon KIT_PSC3M5_EVK. | ||
| * | ||
| * This board defines real GPIOs and the UART node in the upstream Zephyr DTS: | ||
| * - user LED aliases: user_led0 -> GPIO port 8 pin 5, user_led1 -> GPIO port 8 pin 4 | ||
| * - user buttons: SW_1 -> GPIO port 5 pin 0, SW_2 -> GPIO port 2 pin 0 | ||
| * - serial console: uart3 -> scb3 on pins P6_3/P6_2 | ||
| * | ||
| * The upstream board DTS does not define an Arduino Uno R3 header or a PWM/ADC | ||
| * alias table, so this file maps the board-defined GPIOs directly instead of | ||
| * inventing a non-existent Arduino header pin map. | ||
| */ | ||
|
|
||
| &flash0 { | ||
| partitions { | ||
| compatible = "fixed-partitions"; | ||
| #address-cells = <1>; | ||
| #size-cells = <1>; | ||
|
|
||
| user_sketch: partition@10010000 { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. user_sketch offset 0x10010000 is 256 mb, looks like it is out of bounds (far beyond flash0's declared 256 KB). CONFIG_FLASH_MAP=n disables the range check. can you check again this logic? |
||
| label = "user_sketch"; | ||
| reg = <0x10010000 DT_SIZE_K(56)>; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| / { | ||
| zephyr,user { | ||
| /* Execute the sketch through the address used by the Arduino uploader. */ | ||
| sketch-runtime-address = <0x22010000>; | ||
|
|
||
| digital-pin-gpios = <&gpio_prt5 0 0>, /* D0 / SW_1 */ | ||
| <&gpio_prt2 0 0>, /* D1 / SW_2 */ | ||
| <&gpio_prt8 5 0>, /* D2 / LED_0 */ | ||
| <&gpio_prt8 4 0>; /* D3 / LED_1 */ | ||
|
|
||
|
Comment on lines
+38
to
+42
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. digital-pin-gpios = <&gpio_prt5 0 0>, <&gpio_prt2 0 0>, AI is suggesting me something like so that polarity is maintained. cant test that since I don't have a board. Can you have look on that? AI could be wrong also here |
||
| builtin-led-gpios = <&gpio_prt8 5 GPIO_ACTIVE_LOW>, | ||
| <&gpio_prt8 4 GPIO_ACTIVE_LOW>; | ||
|
|
||
| serials = <&uart3>; | ||
| cans = <&can1>; | ||
| }; | ||
| }; | ||
|
|
||
| &uart3 { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &rtc0 { | ||
| status = "okay"; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| targets psc3.cm33 | ||
|
|
||
| telnet_port disabled | ||
| init | ||
| reset init | ||
| halt | ||
| flash write_image erase "${filename0}" | ||
| if {[info exists filename1] && [string length $filename1] > 0} { | ||
| flash write_image erase "${filename1}" ${offset} bin | ||
| } | ||
| reset run | ||
| shutdown | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| /* | ||
| * Copyright (c) Arduino s.r.l. and/or its affiliated companies | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #ifndef __PINS_ARDUINO__ | ||
| #define __PINS_ARDUINO__ | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| /* | ||
| * Minimal Arduino-style pin map for the Infineon KIT_PSC3M5_EVK. | ||
| * | ||
| * This board exposes its real GPIOs in the Zephyr DTS and we mapped the | ||
| * Arduino-style aliases to the actual board-defined GPIOs in the overlay. | ||
| * The mapping here is intentionally conservative and matches the board's | ||
| * runtime GPIO layout without inventing a non-existent Uno R3 header. | ||
| */ | ||
|
|
||
| #define PINS_COUNT (4u) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How this value is defined? |
||
| #define NUM_DIGITAL_PINS (4u) | ||
| #define NUM_ANALOG_INPUTS (0u) | ||
| #define NUM_ANALOG_OUTPUTS (0u) | ||
|
|
||
| #define PIN_LED (2u) | ||
| #define LED_BUILTIN PIN_LED | ||
|
|
||
| /* Arduino-style digital pins used by the board overlay */ | ||
| #define PIN_D0 (0u) | ||
| #define PIN_D1 (1u) | ||
| #define PIN_D2 (2u) | ||
| #define PIN_D3 (3u) | ||
|
|
||
| /* | ||
| * If the board gains ADC-capable GPIOs in the future, these can be mapped here | ||
| * and exposed as A0..A7 in the same way as the rest of the ArduinoCore-zephyr | ||
| * variants. For now the board DTS only exposes the user GPIOs/LEDs and UART. | ||
| */ | ||
| #define PIN_A0 (0u) | ||
| #define PIN_A1 (1u) | ||
| #define PIN_A2 (2u) | ||
| #define PIN_A3 (3u) | ||
| #define PIN_A4 (4u) | ||
| #define PIN_A5 (5u) | ||
| #define PIN_A6 (6u) | ||
| #define PIN_A7 (7u) | ||
|
|
||
| #define PIN_SERIAL_RX (0u) | ||
| #define PIN_SERIAL_TX (1u) | ||
|
|
||
| #define SERIAL_HOWMANY (1u) | ||
| #define SERIAL1_TX (1u) | ||
| #define SERIAL1_RX (0u) | ||
|
|
||
| #define SERIAL_PORT_HARDWARE Serial1 | ||
| #define SERIAL_PORT_MONITOR Serial | ||
|
|
||
| #define WIRE_HOWMANY (0u) | ||
|
|
||
| #endif /* __PINS_ARDUINO__ */ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is later turned off in line 44?