cancel
Showing results for 
Search instead for 
Did you mean: 

CubeProgrammer shows that partition size is negative, fail to program using CubeProgrammer (kernel panic), but successful with raw SD card image using Win32DiskImager

NGajic
Associate III

0693W000007ZBa9QAG.pngHi everyone,

I have a problem using STM32CubeProgrammer (and CLI). They are both showing that my userfs partition have a size of -1162381824 bytes. That partition have size of 2.9GB. After programming with CubeProgrammer I have kernel panic, and I don't know if this is related to CubeProgrammer. I'm trying to program SD card partition by partition using STM32CubeProgrammer but I don't have luck. When I get whole RAW image of SD card and then flash another SD card everything is working. When I get bootfs, userfs, vendorfs and rootfs using dd comand from SD card and then try to program using CubeProgrammer, kernel panic happens. Where I am wrong?

Best regards,

Nenad

6 REPLIES 6
Olivier GALLIEN
ST Employee

Hi @NGajic​ ,

Are you using starter package tsv provided by ST or a generated one your side ?

Any error in offset ? Can you please share it ?

Are you on ST board ?

Thx,

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NGajic
Associate III

Hi @Community member​ ,

I'm using this this tsv:

#Opt Id Name Type IP Offset Binary

- 0x01 fsbl1-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp157c-osd32mp1-brk-serialboot.stm32

- 0x03 ssbl-boot Binary none 0x0 bootloader/u-boot-stm32mp157c-osd32mp1-brk-trusted.stm32

P 0x04 fsbl1 Binary mmc0 0x00004400 arm-trusted-firmware/tf-a-stm32mp157c-osd32mp1-brk-trusted.stm32

P 0x05 fsbl2 Binary mmc0 0x00044400 arm-trusted-firmware/tf-a-stm32mp157c-osd32mp1-brk-trusted.stm32

PD 0x06 ssbl Binary mmc0 0x00084400 bootloader/u-boot-stm32mp157c-osd32mp1-brk-trusted.stm32

P 0x21 boot System mmc0 0x00284400 boot.ext4

P 0x22 vendorfs FileSystem mmc0 0x04284400 vendorfs.ext4

P 0x23 rootfs FileSystem mmc0 0x05284400 rootfs.ext4

P 0x24 userfs FileSystem mmc0 0x33C84400 userfs.ext4

Ext4 partitions are backed up from working SD card using dd (sudo dd if=/dev/sdbX of=<name.ext4>). Trusted firmware and U-Boot is same as working SD card (they are built on virtual machine). I used gdisk on MP1 with working system to compare the partition offsets, and I multiplied starting sector with sector size of 512Bytes and convert that to hexadecimal number and offset is exactly the same as in .tsv file.

Olivier GALLIEN
ST Employee

Hi @NGajic​ ,

Very strange indeed.

I notice you are using osd32mp1 which is Octavo System Sip right ?

Did you try to get help from them ?

Maybe some customization in their software delivery which escape from me ?

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NGajic
Associate III

Hi @Community member​ ,

Yes I'm using Octavo Sip. I will make sure that everything on working SD card is the same (tf-a, u-boot, ext4 backing again), and I will try again. I made one FAT32 storage for USB mass storage (64MB) on userfs, I don't know if that have something with this. You have no clue why is negative size of bytes?

Best regards,

Nenad

Olivier GALLIEN
ST Employee

Hi @NGajic​ ,

>> I made one FAT32 storage for USB mass storage (64MB) on userfs

Probably the issue. So far our boot device only support GPT/EXT4 formating.

See https://wiki.st.com/stm32mpu/wiki/STM32MP15_Flash_mapping

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NGajic
Associate III

Latest news,

I removed file that represented 64MB of FAT32 and then I do the backing up of all partitions with dd. Then used STM32CubeProgrammer_CLI and flashed everything. Again it showed negative size in bytes for userfs partition but now kernel boots, there's no kernel panic. Conclusion is that I have to flash and then I can make FAT32 mass storage file.

Best regards,

Nenad