oliverlee / phobos

TU Delft bike lab embedded systems projects
http://spaaaccccce.com/Space_space_space_Going_Going_there_Okay_I_love_you_space_Yeah_yeah_yeah_okay_okay_Atmosphere_Black_holes_Astronauts_Nebulas_Jupiter_The_Big_Dipper_Im_proud_of_you_son_Space_space_wanna_go_to_space
BSD 2-Clause "Simplified" License
1 stars 5 forks source link

Update toolchain and toolchain download location #162

Open oliverlee opened 7 years ago

oliverlee commented 7 years ago

As previously announced all new binary and source packages will not be released on Launchpad henceforth, they can be found on: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm.

oliverlee commented 7 years ago

Updating the toolchain will bring us to gcc-6 which has cool color output when you compile:

screen shot 2017-03-16 at 11 08 16
oliverlee commented 7 years ago

Note that std::clamp still does not exist.

Reinterpret casts are not allowed in constexpr so some redefinitions will be necessary. For example,

constexpr EncoderConfig RLS_ROLIN_ENC_INDEX_CFG = {
    .z = PAL_LINE(GPIOA, GPIOA_PIN2),
    .counts_per_rev = 152000,
    .filter = EncoderConfig::filter_t::CAPTURE_64, // 64 / 42 MHz (TIM5 on APB1) = 1.52 us for valid edge
    .z_count = 18407
};

will need to change to

constexpr EncoderConfig RLS_ROLIN_ENC_INDEX_CFG = {
    .z = PAL_LINE(GPIOA_BASE, GPIOA_PIN2),
    .counts_per_rev = 152000,
    .filter = EncoderConfig::filter_t::CAPTURE_64, // 64 / 42 MHz (TIM5 on APB1) = 1.52 us for valid edge
    .z_count = 18407
};

as ChibiOS defines GPIOA in os/hal/ports/STM32/LLD/GPIOv2/pal_lld.h using a reinterpret cast to convert an unsigned int to a pointer:

#define GPIOA                           ((stm32_gpio_t *)GPIOA_BASE)

where type of GPIOA_BASE is of type uint32_t.

oliverlee commented 7 years ago

We could also change the standard language to c++1z

oliverlee commented 7 years ago

The compiler also learns the option -Wno-lto-type-mismatch which we can use to disable all the annoying protobuf warnings we get when LTO is enabled.

mickvangelderen commented 7 years ago

What are the implications for developers on this project? Is downloading the new version of the toolchain all that is required for each development machine?

We musn't forget to update the readme.

oliverlee commented 7 years ago

Can't think of anything else.

oliverlee commented 7 years ago

I also think is low priority so we can do it sometime after the July demo.