How can I program Cortex M4 processor?

Forums Reference, Evaluation, and Development Boards How can I program Cortex M4 processor?

Viewing 7 reply threads
  • Author
    Posts
    • #12330
      Ɓngel Molinaamolina
      Participant

      Hi,

      I haveĀ  the OSD32MP1-RED board, and I want to program the Cortex M4 processor. Is possible to do this via STM32CubeIDE? Which are the steps to do this task? Is detailed in any location?

      Thanks in advance.

       

    • #12342
      Neeraj Dantu
      Moderator

      amolina,

      Please take a look at the Getting Started page for DK2 M4 development here: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-M4. You can follow the same procedure if you get an STLink debugger. For the hardware setup(posted for BRK, works for RED as well), please see https://octavosystems.com/forums/topic/getting-started-with-osd32mp1-brk-st-link-jtag-interface/.

      Best,
      Neeraj

    • #12343
      Ɓngel Molinaamolina
      Participant

      Thanks for the reply. Currently I don’t have a STLink debugger, is not possible do the connection to the Cortex M4 without the STLink debugger?

    • #12348
      Neeraj Dantu
      Moderator

      amolina,

      You can also start a debug session via Ethernet. Please see Section 7 of https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-M4/Modify,_rebuild_and_reload_a_firmware for the Cube IDE settings you will need. Note that the board needs to be connected to the same network as the host computer.

      Best,
      Neeraj

    • #12370
      Ɓngel Molinaamolina
      Participant

      Is it possible with a JTAG for example of Texas Instruments? I don’t find availability of the ST JTAGS. I think that is not possible with other JTAG but to be confirmed.

      Thanks in advance.

    • #12376
      Neeraj Dantu
      Moderator

      amolina,

      We have not tried to use TI debuggers with ST device, initial thought is that it would not work.

      I found ST Link V2 available here: https://www.amazon.com/Programmer-Debugger-Microcontroller-Interface-Simulation/dp/B09KV87CH3/ if you are in the US.

      Best,
      Neeraj

    • #12391
      Ɓngel Molinaamolina
      Participant

      Finally I have obtained the the ST Link V2 and I have been able to load the program OpenAMP_TTY_echo that is mentioned in the tutorial. Now I want to write from the A7 to the Cortex M4 and generate a PWM signal, but my doubt is about the hardware configuration in the cortex M4. In the examples provided by ST to the board DK2 they define the pins related for example to the leds and the buttons. My doubt is the next, do I must define in the STM32CubeIDE project (in my case) the hardware that the Cortex M4 will use? Is there some information about this for the Octavo Boards? I have doubts about this, because by one side the hardware is defined yet in the device tree of my Linux image, so I don’t know how procede. Could you indicate me?

      Thanks in advance.

    • #12395
      Neeraj Dantu
      Moderator

      amolina,

      If you use Engineering boot mode,(100b: See Sheet 1 of OSD32MP1-RED schematics) you will not need to do anything to develop on M4 in terms of hardware configuration. The clock tree and pinmuxing can be setup in the M4 firmware code via ST-Link. This is the recommended way of developing code for the M4. This way, you can develop without the interference from the A7 core.

      Once you are done developing code, you can setup the A7 device tree to give M4 access to the right pins and setup the clock tree. You can find more information on setting up the pinmuxing through the A7 core here:https://wiki.st.com/stm32mpu/wiki/How_to_assign_an_internal_peripheral_to_a_runtime_context

      Best,
      Neeraj

Viewing 7 reply threads
  • You must be logged in to reply to this topic.