stm32h743vit6 demo

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

Amir1980
Posts: 12
Joined: Tue Jan 03, 2023 4:03 pm
Has thanked: 2 times

stm32h743vit6 demo

Postby Amir1980 » Sun Jan 22, 2023 8:27 am

Hi,

I am working on my custom board with stm32h743vit6 MCU, I have seen a demo project for stm32h743, RT-STM32H743ZI_REV_XY-NUCLEO144, I have a copy of this project renamed to a new name, made some changes to the config files, the only needed peripherals are an UART (UART5 pins: PC12 and PD2) and a LED (pin: PA7) for blinking. it's all I need to start my chibios learning.

the NUCLEO H743 has a 144pin stm32h743zi, my board has a 100pin h743vit6, I have no idea how to change current config files, I have made some changes but no success blinking LED, please have a look at my config files and let me know if there are other changes needed to make it work.

my debugger is a st-link v2 and st_nucleo_h743zi.cfg file with openocd.

here is the result when start debug:

Code: Select all

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 2000 kHz
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK V2J40M27 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.245204
Info : stm32h7x.cpu0: Cortex-M7 r1p1 processor detected
Info : stm32h7x.cpu0: target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x08001724 psp: 0x200007e0
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (0) size is 1024 kb, base address is 0x08000000
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x08001724 psp: 0x200007e0
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
invalid command name "erase_address"
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400


the main.c file:

Code: Select all

#include "ch.h"
#include "hal.h"
#include "rt_test_root.h"
#include "oslib_test_root.h"
#include "chprintf.h"

/*
 * This is a periodic thread that does absolutely nothing except flashing
 * a LED.
 */
static THD_WORKING_AREA(waThread1, 128);
static THD_FUNCTION(Thread1, arg) {

  (void)arg;
  chRegSetThreadName("blinker");
  while (true) {

    palSetLine(LINE_myLED1);
    chThdSleepMilliseconds(500);
    palClearLine(LINE_myLED1);
    chThdSleepMilliseconds(500);
  }
}

/*
 * Application entry point.
 */
int main(void) {

  /*
   * System initializations.
   * - HAL initialization, this also initializes the configured device drivers
   *   and performs the board-specific initializations.
   * - Kernel initialization, the main() function becomes a thread and the
   *   RTOS is active.
   */
  halInit();
  chSysInit();

  /*
   * Activates the serial driver 1 using the driver default configuration.
   */
  //sdStart(&SD3, NULL);
  //sdStart(&SD5, NULL);

  /*
   * Creates the example thread.
   */
  chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO+1, Thread1, NULL);

  /*
   * Normal main() thread activity, in this demo it does nothing except
   * sleeping in a loop and check the button state.
   */
  while (1) {
    /*if (palReadLine(LINE_BUTTON)) {
      test_execute((BaseSequentialStream *)&SD5, &rt_test_suite);
      test_execute((BaseSequentialStream *)&SD5, &oslib_test_suite);
    }*/
    chThdSleepMilliseconds(500);
  }
}


Regards,
Amir.
Attachments
board.zip
(10.23 KiB) Downloaded 77 times
conf-files.zip
(11.21 KiB) Downloaded 75 times

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: stm32h743vit6 demo

Postby Giovanni » Sun Jan 22, 2023 9:25 am

Hi,

Board files are generated, you should not edit them manually, note the "cfg" directory under the various boards, there is an XML file in there to edit.

This is a video about editing board files, hope it can help: https://www.youtube.com/watch?v=HwJqZfITvV0

Are you using ChibiStudio? the generator of board files is included there, alternatively you can use this script /os/hal/boards/genboard.sh, it requires the installation of the FMPP tool.

About OpenOCD, are you able to reach the main() and step from there?

Giovanni

Amir1980
Posts: 12
Joined: Tue Jan 03, 2023 4:03 pm
Has thanked: 2 times

Re: stm32h743vit6 demo

Postby Amir1980 » Sun Jan 22, 2023 10:23 am

Dear Giovanni,

Thanks for the reply. Yes, I am using chibistudio, I wish to use keil with chibios and its hal libraries, but I don't know how to use it with keil. I have not tried yet.

about the openOCD, I guess it stuck in halInit.

if you mean board.chcfg by xml file, yes, I have modified it too, but didn't use genboard to regenerate it. I will try and reply.

Regards,
Amir.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: stm32h743vit6 demo

Postby Giovanni » Sun Jan 22, 2023 10:32 am

Hi,

Make sure to look at the ChibiStudio guides on http://www.playembedded.org most topics are covered there.

Giovanni

Amir1980
Posts: 12
Joined: Tue Jan 03, 2023 4:03 pm
Has thanked: 2 times

Re: stm32h743vit6 demo

Postby Amir1980 » Sun Jan 22, 2023 4:51 pm

Hi,

Code: Select all

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J40M27 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.246781
Info : stm32h7x.cpu0: Cortex-M7 r1p1 processor detected
Info : stm32h7x.cpu0: target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x08001724 psp: 0x200007e0
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (0) size is 1024 kb, base address is 0x08000000
Info : Device: STM32H74x/75x
Info : flash size probed value 2048k
Info : STM32H7 flash has dual banks
Info : Bank (1) size is 1024 kb, base address is 0x08100000
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x08001722 psp: 0x200007e0
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
invalid command name "erase_address"
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
Info : Padding image section 0 at 0x080021b0 with 16 bytes (bank write end alignment)
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
Info : Padding image section 0 at 0x080021b0 with 16 bytes (bank write end alignment)
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000378 msp: 0x20000400
Info : dropped 'gdb' connection (error -400)


here is the result of program and debug after regenerating xml file using genboard.sh.

it seems there is a problem with debugging.

Code: Select all

target halted due to debug-request, current mode: Thread


is it okay to use st_nucleo_h743zi.cfg file for stm32h743vit6?

Regards,
Amir.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: stm32h743vit6 demo

Postby Giovanni » Sun Jan 22, 2023 5:05 pm

Hi,

I launch OpenOCD from ChibiStudio using "OpenOCD on STLink (prompts for .cfg target configuration)".

Then I select /openocd/scripts/target/stm32h7x.cfg or /openocd/scripts/target/stm32h7x_dual.cfg depending on device.

This is board-independent.

Giovanni

Amir1980
Posts: 12
Joined: Tue Jan 03, 2023 4:03 pm
Has thanked: 2 times

Re: stm32h743vit6 demo

Postby Amir1980 » Mon Jan 23, 2023 10:40 am

Dear Giovanni,

Thanks, I have found the problem, it was using LSE by default which I don't use, switched to LSI, its working now.

Thanks for your support.

Regards,
Amir.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 29 guests