C++Now 2018: Michael Caisse “Modern C++ in Embedded Systems”

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 มิ.ย. 2024
  • cppnow.org
    -
    Presentation Slides, PDFs, Source Code and other presenter materials are available at: cppnow.org/history/2018/talks/
    -
    For nearly 35 years I have been working with small processors and there has always been deep divides between practitioners of languages. When writing assembly we ridiculed those using C and when I spent years microcoding we scoffed at everyone. However, nearly all groups continue to wag their heads at the shameful C++ programmers attempting to twist their tools toward the small.
    Recent language developments have made C++ the obvious choice for many embedded projects; nevertheless, the toxic environment extends past reddit roasts into poor vendor support of tools and nearly obstructionist chip manufacturers.
    This session will use a bare-metal project started in 2018 for a Ciere client as a case study while we work through the decision process for using C++, the acrobatics required to support the language, recent language features that enable goals of size, speed, and expressiveness, and useful libraries.
    While the examples will be based on a concrete project, the extracted lessons-learned should be applicable to many embedded projects (bare-metal and small-OS). Attendees will walk away with motivations to use C++ in embedded projects, hints and tips to making tools work, and a sampling of language features and idioms that improve the quality of a final product.
    -
    Michael Caisse
    Ciere, Inc.
    Michael Caisse has been crafting code in C++ for 28-years. He is a regular speaker at various conferences and is passionate about teaching and training. Michael is the owner of Ciere Consulting which provides software consulting and contracting services, C++ training, and Project Recovery for failing multidisciplinary engineering projects. When he isn't fighting with compilers or robots, he enjoys fencing with a sabre. :: ciere.com
    -
    Videos Filmed & Edited by Bash Films: www.BashFilms.com
    ---
    *--*
    ---
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 40

  • @shirshzibbu330
    @shirshzibbu330 3 ปีที่แล้ว +10

    42:40 "the good stuff starts at time mark 45"

  • @richardvonlehe4581
    @richardvonlehe4581 5 ปีที่แล้ว +6

    Thank you. This was cathartic for me to watch as someone who also bucks the convention of "C only" for microcontrollers. Also thanks for the introduction to Boost.SML. Watching that next.

  • @petermuller9518
    @petermuller9518 6 ปีที่แล้ว

    I can so feel you, having suffered the same struggle when making C++ work on our product

  • @GurpreetKakar4873
    @GurpreetKakar4873 6 ปีที่แล้ว +2

    Excellent talk.

  • @manofacertainrage856
    @manofacertainrage856 6 ปีที่แล้ว +1

    That was an amazing talk. Thank you.

  • @idan4329
    @idan4329 5 ปีที่แล้ว

    any thoughts on : Keynote: What can C++ do for embedded systems developers? - Bjarne Stroustrup"" ?

  • @alexandrebustico9691
    @alexandrebustico9691 6 ปีที่แล้ว +1

    Thanks for this talk. Ladon library seems interesting, is it open source ? I hardly found it searching google and github

    • @MichaelCaisse_ciere
      @MichaelCaisse_ciere 6 ปีที่แล้ว +7

      Ladon is not open sourced ... yet. We are considering how to proceed with making the library available.

  • @edobez
    @edobez 5 ปีที่แล้ว

    Talking about state machines, have you ever tried to use QP/C++ (www.state-machine.com/)? Maybe it doesn't use as much of the modern C++ tecniques as Boost.SML, but it seems to me a more mature piece of SW.

  • @pedrovictor8666
    @pedrovictor8666 5 ปีที่แล้ว +1

    I'm interested in knowing more about embedded. In this matter, all I have worked with is using timers and other peripherals in Atmega328p. I uploaded the code to the board by clicking "upload" in Atmel Studio 7. I didn't really configure anything other than selecting the board and tht's pretty much all I know. How would I go about learning how to do this more manually, as I think is the case presented in this talk? I'm referring to CMake files and Linker scripts, and also how to implement a good abstraction layer API for Timers, ADCs etc. It does seem a little overwhelming and I would appreciate any guidance :)

    • @EdwinFairchild
      @EdwinFairchild 4 ปีที่แล้ว +1

      did you ever take on this challenge to try and learn how to really program the chip?

  • @cstrieder
    @cstrieder 6 ปีที่แล้ว +6

    Where do I buy a smart pointer like that?

    • @dinoscheidt
      @dinoscheidt 3 ปีที่แล้ว +2

      Two years late but for anybody reading by: It’s the Logitech Spotlight Presenter - If the target computer has the spotlight app installed, the gyro position of the device is send while the top button is pressed. The highlighted area can be styled yourself, like he did here.

  • @ReagueOfRegends
    @ReagueOfRegends 5 ปีที่แล้ว

    Starting an embedded job as a fresh CompE grad soon; not sure if this was encouraging or intimidating, but a good talk nonetheless!

    • @MichaelCaisse_ciere
      @MichaelCaisse_ciere 5 ปีที่แล้ว

      Good luck with the new job! Don't be intimidated. If you are ever at a conference and I'm there, find me and let me know how it is going.

  • @anthonyrocha8075
    @anthonyrocha8075 2 ปีที่แล้ว

    Where is the source code for this presentation?

  • @RudMerriam
    @RudMerriam 5 ปีที่แล้ว +4

    Terrific talk. Was laughing out loud a few times. BTDT frequently on most of what you said.
    Did the startup code for a Moto 68332 in early 90s. Wrote pages of #defines for every bit and its position in the registers. Created #define macros for every register which merged the bits and wrote to the register. One of the best compliments I've gotten from a hardware guy was, "I think I could create the startup code using Rud's work."
    Wrote some articles on using C++ for embedded systems. Mainly was for Arduino and some Pi but the concepts are the same for other systems. hackaday.io/project/8238-embedding-c
    Especially like the comment around 55:00 that if your reaching for the debugger you've already got a problem. One embedded system I created had 24 LEDs: 8 red for error status and 16 green for operating status. You could diagnosis the system using the LEDs. But 8 green ones were only used by developers for debugging.
    I always prided myself on debugging skills. I could think through the system flow and would then realize the bug had to be in a specific section. Walking through the code usually found the problem. On some of the first systems I did we had In Circuit Emulators (ICE) that allowed step by step execution on the hardware.
    Find it funny that embedded developers apparently don't trust the compiler and need to step through code. In all my decades that is not something I've worried about and can't recall ever finding a bug caused by bad compiler code generation.

  • @Tinfoilpain
    @Tinfoilpain 5 ปีที่แล้ว +1

    I feel so included in this talk

  • @maximilian19931
    @maximilian19931 3 ปีที่แล้ว

    so count_if with value as filter and a const list which contains the item, will calculate the answer at compiletime, massively reducing compute time!! NICE

  • @patlecat
    @patlecat 6 ปีที่แล้ว

    C++ on Arduino or RaspPie is so unaccesssible as well. Who can help to bring the TTHW down to 1 minute instead of 1 month?

    • @HermanWillems
      @HermanWillems 4 ปีที่แล้ว +1

      ssh into raspberry pi. touch HelloWorld.cpp then Nano HelloWorld.cpp write helloworld code save and compile with GCC and run.

  • @RaaynML
    @RaaynML 3 ปีที่แล้ว

    3:10 it's actually because of the insane crowd of gasoline engines sitting in traffic or speeding on the highway that causes that noticeable smog, diesels are generally heavily filtered and don't produce much carbon emissions, their nox emissions are higher, so the exhaust is technically worse for humans but doesnt effect the environment so much

  • @mhassaankhalid1369
    @mhassaankhalid1369 2 หลายเดือนก่อน

    this looks like a Renesas mpu RZ/T1

  • @Hauketal
    @Hauketal 6 ปีที่แล้ว +3

    Bug in example code at 52:02, sizeof(data) is too large by a factor of sizeof(int).

    • @bktero
      @bktero 5 ปีที่แล้ว

      Why? The 'end' iterator is not used in the algorithm and 'data+sizeof(data)' points to the next int right after 'data'. So it goes through the array and when the internal iterator equals the 'end' iterator, it stops without. Am I missing something?

    • @Hauketal
      @Hauketal 5 ปีที่แล้ว +3

      bktero Yes, you are missing the (inherited from C) fact, that pointer±integer scales the integer by sizeof(*pointer) before the addition.
      Correct method:
      #define ELEMS(a) (sizeof(a)/sizeof((a)[0]))
      end=data+ELEMS(data);
      Like the version in the video, this only works if data has not decayed from array to pointer, i.e. is not a function parameter.

    • @bktero
      @bktero 5 ปีที่แล้ว +1

      You are absolutely write. My bad... I often write code like the one in the video but with byte arrays and it works in that case. But that's a special case. And I also std::array and it's size() member function.
      I also misunterstood 'factor' in your sentence. I was thinking 'it is a going on step too far' but no, it is going a lot of steps too far.

    • @MichaelCaisse_ciere
      @MichaelCaisse_ciere 5 ปีที่แล้ว +7

      Indeed. Embarrassing. In an effort to make some of the code more familiar to people with little C++ experience I decided to not use std::begin and std::end.
      It should have just been written : std::count_if(std::begin(data), std::end(data) ...

  • @r-jwolthuis7243
    @r-jwolthuis7243 6 ปีที่แล้ว

    What is meant with the remark about the use of header-only libraries? At th-cam.com/video/c9Xt6Me3mJ4/w-d-xo.htmlm

    • @EdwinFairchild
      @EdwinFairchild 4 ปีที่แล้ว +1

      a library/code that you made to reuse but all of your code is just in one header file

  • @KarelDonk
    @KarelDonk 6 ปีที่แล้ว

    Regarding getting c developers to switch to c++, check this blog.kareldonk.com/convincing-c-programmers-to-switch-to-c-a-look-at-human-thinking-behavior/

  • @Minh-si1zz
    @Minh-si1zz 3 ปีที่แล้ว

    boost sml is too expert for me

  • @maximkosheleff
    @maximkosheleff 5 ปีที่แล้ว

    1:30:37 rare noticed truth

  • @wdmeister
    @wdmeister 6 ปีที่แล้ว +7

    58:30 i would clap as well :)

  • @dangbinghoo
    @dangbinghoo 5 ปีที่แล้ว

    for this kind of bare metal system, you should just try D or Rust, those two just works better than cpp.

    • @HermanWillems
      @HermanWillems 4 ปีที่แล้ว +10

      Can you also give some good solide arguments for that? rather then just say "works better" but actually give arguments why?