Q&A


Everything you always wanted to know about Eclipse, Embedded Systems Programming, Software and Tools, or any topics of this blog, but where afraid to ask, then this page is for you.

Post a comment, and you might get an answer, either from myself or from the readers of this blog. Otherwise: the answer is always ‘42‘ 😉

For feature requests or bug reports on the McuOnEclipse project end Processor Expert components, you should use the GitHub issue tracking system:

1,012 thoughts on “Q&A

  1. Hi Erich,

    There are various CAN interface devices like the Vector CAN Case, the Komodo CAN Interface, etc. I am not very familiar with how these interfaces communicate with the PC over USB. Do you know the data is transmitted over USB? I will start experimenting with NXP USB examples for FRDM boards. My goal is to use a FRDM board with a CAN interface to capture CAN traffic and then send to a PC Application over USB for displaying the CAN ID and the payload. I imagine there is some data packet protocol involved in the data transmission. Do you have any projects along these lines, perhaps reading Sensor Data or Telemetry Data?

    Thanks,
    David

    Like

    • Hi David,
      I have not worked with CAN recently, and I don’t have a project to share with you.
      There is to my knowledge no special Can2USB protocol. Most do a simple CAN-to-Serial (UART, USB CDC) conversion. Simply capture things on the CAN side and transmit as USB CDC data to the host, and vice versa.

      Erich

      Like

  2. Hi Erich

    I want to develop Arm Coretex M4 code on an Arm MPS2 development board. I don’t currently have a debug probe but the MPS2 has a USB port that supports CMSIS-DAP debug. I have used this successfully with the Arm Development System suite, but I want to use Visual Studio Code instead. My question is, what software components do I need to build a debug system using Visual Studio Code, targeting the USB CMSIS-DAP debug device, and using the armclang toolkit?

    I have a good understanding of VS Code.

    I have a CMake script that builds an elf file from our source using the armclang tools. I am familiar with how to integrate CMake with VS Code.

    Arm has an Arm Embedded Debugger VS Code extension which I think supports CMSIS-DAP. Would that be a good way forward? (https://marketplace.visualstudio.com/items?itemName=Arm.embedded-debug).

    And then, do I need OpenOCD and the arm debugger (not sure what that is) ?

    Any hints would be appreciated.

    Best regards
    David

    Like

    • Hi David,
      you need a debug server (e.g. OpenOCD) which talks over CMSIS-DAP with your debug probe. And you need to configure OpenOCD with the correct script/settings for your target board.

      Like

  3. Hi Erich,

    First of all, I thank you for developing such a great plugin PEx, I am learning to use it now. I am using a key module on kl05z and I am not sure how to configure it to use it properly. The programming environment I am using is – CodeWarrior for MCU Version: 11.1 Build Id:181224. thank you!

    Best regards.
    Lance

    Like

      • Hi Erich,

        The idea I got from your project is to add a timer module on top of the component and then trigger AddTick() in the timer interrupt function.
        Now there are 2 problems:
        1, After configuring the timer when not using freertos, the keys are not responsive enough and need to be pressed 2 times to achieve the function. I am not quite sure what is causing this.
        2, I want to use the key component in freertos short press and long press and hold state, is it open the RTOS in TRG?Do I still need a timer trigger?

        Best regards.
        Lance

        Like

        • Hi Lance,
          1. Are you using interrupts or polling? For polling, you need to poll it frequently enough (say every 10 ms or so). For the timer, this needs to be fast enough (faster than the debouncing wait time, so for example configure it to 10 ms).
          2. If using FreeRTOS, you have to feed the trigger (TRG_AddTick()) every 10 ms or so too. You can do this from the FreeRTOS tick hock.

          Like

      • Hi Erich,

        The advice you gave me was great, and it all hit the nail on the head. I basically understand all the features now. However, I have one last question. It’s a question about the interrupts and the FreeRTOS tasks running between them. I have 1 light bead blinking any configured in FreeRTOS, and I want to implement a 2 second delay in the OnKeyHold interrupt to turn off the light bead blinking. But then after I press the switch for a long time, the program stays in OnKeyHold directly interrupting the task of holding down the button while the light bead is blinking. I want to use OnKeyHold to avoid key state malfunction, but at the same time I want the FreeRTOS task to run continuously until the key is not placed for 2 seconds. I am not sure what is a better way to achieve my needs, thank you!

        Best regards.
        Lance

        Like

        • Hi Lance,
          good to hear that things are making progress. As for your question: do you have interrupts configured for level or edge? It should be on Edge, and then you should only get one interrupt (ideally).
          Otherwise you might need to turn off the button interrupt and turn it on again at the end.
          As a general solution to your use case (if I understand it correctly): you always can send events from the interrupt to your task in question.

          Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.