Skip to content

ports/stm32: Make ETH DMA buffer attributes configurable. #16633

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

Conversation

kwagyeman
Copy link
Contributor

This commit allows the attributes for the eth_dma buffer to be overridden by a port.

OpenMV's firmware for the Arduino Portenta stores .data in the DTCM which is inaccessible by the ethernet controller. By overriding the buffer's attributes with alignment and section specifications, we can place the ethernet buffer in the right SRAM location.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@kwagyeman
Copy link
Contributor Author

@iabdalkader

@@ -193,6 +193,10 @@ extern const struct _mp_obj_type_t network_lan_type;
#define MICROPY_HW_NIC_ETH
#endif

#ifndef MICROPY_HW_ETH_DMA_ATTRIBUTE
#define MICROPY_HW_ETH_DMA_ATTRIBUTE __attribute__((aligned(16384)));
#endif
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be better in mpconfigboard_common.h, near the bottom of that file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Kwabena W. Agyeman <kwagyeman@live.com>
@kwagyeman kwagyeman force-pushed the kwabena/configurable_dma_buffer branch from 6bd6729 to 84f883d Compare January 25, 2025 17:49
@dpgeorge
Copy link
Member

dpgeorge commented Feb 4, 2025

Rebased and merged in 112f657

@dpgeorge dpgeorge closed this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants