Skip to content
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

Support for TawakiV2 (STM32H7) #3199

Merged
merged 12 commits into from
Dec 14, 2023

Conversation

Fabien-B
Copy link
Contributor

No description provided.

@fvantienen
Copy link
Member

What about the defines in mcuconf.h is this not enough for you to set the nocache regions?:

 * Memory attributes settings.
 */
#define STM32_NOCACHE_ENABLE                TRUE
#define STM32_NOCACHE_MPU_REGION            MPU_REGION_6
#define STM32_NOCACHE_RBAR                  0x24000000U
#define STM32_NOCACHE_RASR                  MPU_RASR_SIZE_64K

Because I prefer to keep it then the same for every board, either we do it ourselves or use the ChibiOS features to set the MPU.

Next to that your tawaki_v2.0.h is almost the same as the common_board.h. Isn't it better to change the names in board.cfg such that common_board.h can be used and the features that are missing can be added there?

These are just some suggestions, but I really like the fixes that you have done :)

@Fabien-B
Copy link
Contributor Author

I will try looking into your suggestions, but it may not be easy.
First annoying thing:

common_board.h:

#define LED_1_GPIO_ON     gpio_clear
#define LED_1_GPIO_OFF    gpio_set

tawaki_v2.0.h:

#define LED_1_GPIO_ON     gpio_set
#define LED_1_GPIO_OFF    gpio_clear

@fvantienen
Copy link
Member

I will try looking into your suggestions, but it may not be easy. First annoying thing:

common_board.h:

#define LED_1_GPIO_ON     gpio_clear
#define LED_1_GPIO_OFF    gpio_set

tawaki_v2.0.h:

#define LED_1_GPIO_ON     gpio_set
#define LED_1_GPIO_OFF    gpio_clear

Maybe a good solution for that would be to define NLED1 as a name in the cfg file or something like that to indicate it is inverted.

conf/airframes/ENAC/quadrotor/TawakiV2.xml Outdated Show resolved Hide resolved
conf/modules/board_tawakiV2.xml Outdated Show resolved Hide resolved
sw/airborne/arch/chibios/mcu_periph/hal_stm32_dma.h Outdated Show resolved Hide resolved
@alex31
Copy link
Contributor

alex31 commented Dec 12, 2023

What about the defines in mcuconf.h is this not enough for you to set the nocache regions?:

 * Memory attributes settings.
 */
#define STM32_NOCACHE_ENABLE                TRUE
#define STM32_NOCACHE_MPU_REGION            MPU_REGION_6
#define STM32_NOCACHE_RBAR                  0x24000000U
#define STM32_NOCACHE_RASR                  MPU_RASR_SIZE_64K

Because I prefer to keep it then the same for every board, either we do it ourselves or use the ChibiOS features to set the MPU.

Next to that your tawaki_v2.0.h is almost the same as the common_board.h. Isn't it better to change the names in board.cfg such that common_board.h can be used and the features that are missing can be added there?

These are just some suggestions, but I really like the fixes that you have done :)

The H7 provides 3 different domains, and we need "nocache" regions in 2 regions, to support all of our dma bound peripherals. Chibios mechanism permit to define only one region via mcuconf.h.
We define 2 regions in our custom code, so STM32_NOCACHE_ENABLE should be set to FALSE in mcuconf.h

Copy link
Member

@gautierhattenberger gautierhattenberger left a comment

Choose a reason for hiding this comment

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

Can be merged once tested in flight

@Fabien-B
Copy link
Contributor Author

Tested multiple times, it works.

@gautierhattenberger gautierhattenberger merged commit f7a981a into paparazzi:master Dec 14, 2023
1 check passed
dewagter pushed a commit to tudelft/paparazzi that referenced this pull request Dec 17, 2023
* tawakiV2 support.
* clean and update linker scripts
* update ram configuration
* update chibios
* update airframe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants