Skip to content

Conversation

@thenguyenyf
Copy link
Contributor

  • Add support for MCK-RA4T1 board
  • Updated samples, tested to run with supported drivers on this board

Update revision of hal_renesas to get RA4T1 support

Signed-off-by: Khoa Tran <[email protected]>
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_renesas zephyrproject-rtos/hal_renesas@62136a8 zephyrproject-rtos/hal_renesas#167 zephyrproject-rtos/hal_renesas#167/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.


uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;

volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not static (line 27)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a re-declaration for a global context used in another place so it cannot be added with the static keyword.

Comment on lines +41 to +45
extern volatile uint16_t g_protect_counters[];

for (uint32_t i = 0; i < 5; i++) {
g_protect_counters[i] = 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea what this is, doesn't appear to be used anywhere else in whole PR

Suggested change
extern volatile uint16_t g_protect_counters[];
for (uint32_t i = 0; i < 5; i++) {
g_protect_counters[i] = 0;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above explanation, this is a global context that used in another place, and it should be properly assigned an initial value. We are considering moving it into more suitable place. But right now, for this board support, I think we should keep it as it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ctrl+f'd through the PR and found no other instance of usage, so where it is used? Why does it not work using the zephyr driver model?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used for a BSP function placed in HAL: R_BSP_RegisterProtectEnable

g_protect_pfswe_counter = 0;

#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wearyzen can you have a review of this and check this is OK?

Comment on lines 102 to 104
.. code-block:: console

west flash -r jlink
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent looks very wrong, also why is this needed when the above hello world bit does this already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of the sample overlays looks like they ought to be added on the board level instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be added on the board level, not under a test-specific overlay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This board does not equipe a CAN transceiver, so I don't enable CANFD node on board by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a reason for enabling the CAN tests, then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After consideration, I have removed these tests as the CAN controller is not enabled on the board. Please check it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be added on the board level, not under a test-specific overlay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think it’s necessary to create a separate .dtsi file for this type. From my perspective, to keep it as simple as possible, we only need three layers for the SoC: the common .dtsi → flash type .dtsi → specific .dtsi.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By software view, the grouping by pin num is fit with describe in HWM for all part numbering, that:

  • Feature set: specific how many HWIP was added on this PN
  • Pin num: specific which GPIO port and which pin existed on this PN
  • Flash size: specific its code flash size on this PN

So, for RA4T1 this is the ideal way to optimize maintenance effort and avoid duplicate definitions for each PN, that usually meet in case of the ports/pins are identical for all PNs belonging to the product with the same pin count.

zephyr,console = &uart9;
zephyr,shell-uart = &uart9;
zephyr,entropy = &trng;
zephyr,flash-controller = &flash1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zephyr,flash-controller = &flash1;
zephyr,flash-controller = &flash;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's a bug/issue, but all RA4 device with renesas,ra-flash-hp-controller have the same definition. If it's correct, should we send a PR to correct it for all other boards?

Add support for Renesas RA4T1 SoC series

Signed-off-by: Khoa Tran <[email protected]>
Add RA4T1 SoC's ELC signal enums for devicetree bindings

Signed-off-by: Khoa Tran <[email protected]>
Add dts support for Renesas RA4T1 SoC series

Signed-off-by: Khoa Tran <[email protected]>
Add board layer support for Renesas mck_ra4t1 board

Signed-off-by: Khoa Tran <[email protected]>
Add support for sample app on Renesas mck_ra4t1:
- samples/drivers/counter/alarm

Signed-off-by: Khoa Tran <[email protected]>
Add support for sample app on Renesas mck_ra4t1:
- samples/drivers/dac

Signed-off-by: Khoa Tran <[email protected]>
Add support for sample apps on Renesas mck_ra4t1 board:
- samples/drivers/adc/adc_dt
- samples/drivers/adc/adc_sequence

Signed-off-by: Khoa Tran <[email protected]>
Add ELC sample support for Renesas mck_ra4t1

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/uart/uart_async_api

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app Renesas mck_ra4t1:
- tests/drivers/spi/spi_loopback

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/i2c/i2c_api

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/counter/counter_basic_api

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/adc/adc_accuracy_test
- tests/drivers/adc/adc_api

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/dac/dac_api
- tests/drivers/dac/dac_loopback

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/dma/chan_blen_transfer
- tests/drivers/dma/chan_blen_transfer

Signed-off-by: Khoa Tran <[email protected]>
Add support for test app on Renesas mck_ra4t1:
- tests/drivers/flash/common

Signed-off-by: Khoa Tran <[email protected]>
Add ELC test support for Renesas mck_ra4t1

Signed-off-by: Khoa Tran <[email protected]>
@thenguyenyf thenguyenyf force-pushed the renesas_mck_ra4t1_support branch from 0e6a629 to 8282e7a Compare November 10, 2025 08:20
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-hal_renesas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants