Disappearing after Bootloader recognition

I uploaded PX4 Bootloader in STM32F446 and can find the COM PORT (PX4 FMU) at the device manager as shown below.

However, it disappears a few seconds later.

If I connect at the QGC for F/W upload, it is not disappears as shown blow.

I think the F/W is not operating because of this.

Is the Bootloaderā€™s problem?

@DoEon_Lee: this is not necessarily a bootloader problem. When you plug the board in via USB, it will remain in the bootloader for 5s and then jump to the main application. If you started talking to the bootloader via USB before it jumped to the main app, then it should remain in the bootloader.

What I suspect is happening, is that your board shows up on your computer when it is in the bootloader and then ā€œdisappearsā€ when the bootloader jumps to the main application. In your NuttX defconfig file for your board, your ā€˜consoleā€™ is probably set up on one of the UART ports. This means that when you enter the main app, the USB is not configured, hence why you donā€™t see the board on your computer when it has powered up.

I hope that made some sense.

@DoEon_Lee: Since you are using a STM32F446 and not an STM32F427 (as on the Pixhawk), there might be some NuttX configurations that need to be changed to account for the change in the chip.

Have you configured the NuttX defconfig file to to use the STM32F446 and not STM32F427?

Could you elaborate which item is needed to change in defconfig?

There is a line in the defconfig file set as CONFIG_ARCH_CHIP_STM32F427V=y. This tells NuttX that it is using an STM32F427Vx chip. This should be unset # CONFIG_ARCH_CHIP_STM32F427V is not set and the appropriate STM32F446 chip should be selected

# CONFIG_ARCH_CHIP_STM32F446V is not set
# CONFIG_ARCH_CHIP_STM32F446Z is not set

Do you have access to the UART console for your board? Do you see the NSH console?

Thanks for the quick reply. My problem is about downloading firmware. I have opened an issue in the main page. I use STM32F427IIH6, but QGC always says erase failed. I cannot figure out what the problem is.

As another evidence, I tried to upload the F/W via console, and got the following problem:
sn: 003600303333470630323032
chip: 10036419
family: STM32F42x
revision: Y
flash 1032192

Erase : [ ] 0.0%
ERROR: Programing not supported for this version of silicon!
See https://pixhawk.org/help/errata
[100%] Built target upload

How could the silicon not supported??!?

There is a configuration part. (Bootloader - main_f4.c)

I changed #define FIRST_BAD_SILICON_OFFSET 0 to 2, because revision is ā€˜Aā€™ in my case.

Try changing this value.

Thank you for your reply.

I changed the defconfig, but it is not operating too.
(Firmware - nuttx-configs - px4fmu-v4 - nsh)
In addition, I changed the clock in board.h and ld.script configuration for STM32F446.
(My board is operating with 8 MHz OSC)

I connected alomost every UART port and it was not operate.
I think, there is a problem in PX4 F/W, so I cannot find at device manager. (Just can see bootloader)

I donā€™t know what should I do anymore.

@doctorluhang:

You have a older version of the STM32F427 chip (Revision Y). With this version of the silicon, you are unable to reliably access the second 1MB bank of the flash and use the USB at the same time. See more about this error here. Hence if you are using a revision Y silicon chip, you can only use the first 1MB of flash, hence why it your bootloader returns with the flash size being 1032192 bytes instead of 2080768 bytes.

Are you using a normal Pixhawk board?

@DoEon_Lee: You are compiling the bootloader for either the PX4_FMU_V2 target or the PX4_FMU_V4 target. If you add your own target to the bootloader makefile, this check on the silicone revision will not be performed. It is only performed for the V2 and V4 tragets (see code extract below):

#if defined(TARGET_HW_PX4_FMU_V2) || defined(TARGET_HW_PX4_FMU_V4)

	if (check_silicon() && board_info.fw_size == (2 * 1024 * 1024) - BOOTLOADER_RESERVATION_SIZE) {
		board_info.fw_size = (1024 * 1024) - BOOTLOADER_RESERVATION_SIZE;
	}

#endif

@DoEon_Lee: I donā€™t think the problem lies with the PX4 F/W itself, I think it has to do with your configuration of NuttX for the STM32F446 chip. Unfortunately there a number of things that could be different between your F446 and the standard F427. I know there is a difference between the USB registers for the F446 and the F427, so I really hope that the correct USB registers are being used in your compilation.

Also, if you are using a ā€œstandardā€ defconfig for the px4fmu-v4, then you do not have the console on the USB, so it will not show up on your computer.
The following lines will need to be set

CONFIG_CDCACM_CONSOLE=y
CONFIG_NSH_USBCONSOLE=y
CONFIG_NO_SERIAL_CONSOLE=y

This should put the NSH console on the USB port. This might still not work, owing to difference in USB register between the F446 and F427, but it is worth a try.

When you recompile, make sure you run make clean first, to make sure that your new config files are used for the compilation.

Thank you for your reply.
I configured the variable in defconfig file and bootloader, but it is not operating yet.
I donā€™t know what can I do anymore.

@david_s5, @dagar I donā€™t suppose you have any ideas as to what needs to be done to bring up an STM32F446 board with the least amount of effort? I havenā€™t worked with one yet, so I donā€™t know what problems @DoEon_Lee might be having.

The 446 has significant differences from the 427 notably the PLL configuration and the USB module. I imagine you could use code from px4esc-v1 as it uses the 446.

Already, I modified clock configuration. (HSE, 16MHz)
There are configuration parts in ā€œFirmware - nuttx-configs - px4fmu-v4 - include - board.h.ā€
In addition, I modified the ld.script (Firmware - nuttx-configs - px4fmu-v4 - scripts)
Please, let me know if you know any other related parts.

It will not run, unless you use the nuttx-configs/px4esc-v1 and src/drivers/boards/px4esc-v1 as your starting point. Then you will have to create your own nuttx-configs/px4fmu-e446 and src/drivers/boards/px4fmu-e446 as a merge of the px4fmu-v2 and the px4esc-v1 that uses the STM32F446. I named it e for Experiment and 446 for the CPU.

Because the USB is different, you will also need a px4 bootloader that will work on the 446 (see the F7 or f469 bootloaders) and a unique board_id so QGC can load the correct FW. You can use 111 for the board_id.

I donā€™t know why I have to use px4esc-v1 and px4fmu-v2? I want to use v4. How can I change the starting point?
I created px4fmu-e446 and brought the px4fmu-v4ā€™s contents, but there was problems. Maybe I have to match some materials. Iā€™m not sure.

In addition, I think the USB part is same. So the device is well connected with QGC from the last time.

Because the PLL and USB are different you will have to use px4esc-v1 as your starting point and merge in v4 and your changes to the pins.

Hi @ksschwabe, I am facing a similar issue while flashing Px4 stable v 1.12.3 version onto my official Holybro pixhawk 6x.
The USB serial port disappears after successful firmware flash.

When i flash stable versions v1.13.0 and v 1,14,0 , I can see the bootloader port initially for a few seconds and then serial com port stays permanently. This is not the case in v 1.12.3

As I need the version for connecting with matlab, can u suggest what i can do?