raspberry pi uboot: adding poweroff command fail

After bumping up my confidence with adding a simple custom command in uboot for raspberry pi, I searched on how I can implement a custom poweroff command.

However, it looks like a perfect poweroff command is impossible due to hardware limitations. My googling suggests that rpi doesn’t have any hardware support that can allow software to cut the incoming power. Such neat practices require ACPI or PMIC.

I should check out the rpi schematic to see if there really is no PMIC chip in rpi.

Also, if I can’t get it to poweroff neatly at least I can try to mimic one by turning of the SOC perhaps?


uboot on raspbery pi2 with splashscreen

Progress so far:

  • tried to build a uboot image for rpi3. Miserably failed. some setting with the compilers seems to be off.
  • fortunately, rpi2 build works very well. I can get get the build images.
  • confirmed that the vanilla build works well with rpi2. Made some changes in the ‘config.txt’ file in /boot partition of the rpi sd card so that I can access the uboot prompt through UART communication.
  • succeeded adding a very simple custom command in uboot.
  • wanted to display some picture or whatever with uboot.


The failure with displaying a picture on the display with uboot seems to be a complicated matter. I think there are two problems that I should tackle

  1. enabling BMP command

From various uboot splashscreen tutorials, most of them utilize a ‘bmp’ command. Apparently, this is the command that will display a bmp image file to the display. However, this command is not included in the default uboot .config option. One must manually add ‘CONFIG_CMD_BMP’ configuration.

Further digging suggested that enabling ‘CONFIG_CMD_BMP’ alone is not enough. In order to this to work properly, one must also turn on other ‘CONFIG_’s as well.



2. raspberry display related address is messed up

One of the replies written in this thread suggests that raspberry pi’s default address configuration is messed up in a way that the display driver will corrupt other critical memory regions whenever it will try to show something up on the display.

Here is what the comment says:

Hi a little (headache) contributed from me:
If you want use the Splash screen of bitmap display in bootmap , there is a bug in the video driver.
The panel_info.cmap is not allocated and have a NULL value. So the cmap is fill at 0x0 and lot’s of essential data like device tree too (at 0x100) is overwritten.

index 7867fe3..6f450b2 100644
--- a/drivers/video/bcm2835.c
+++ b/drivers/video/bcm2835.c
@@ -102,14 +102,16 @@ void lcd_ctrl_init(void *lcdbase)
panel_info.vl_col = w;
panel_info.vl_row = h;
panel_info.vl_bpix = LCD_COLOR16;
-       gd->fb_base = msg_setup->allocate_buffer.body.resp.fb_address;
+    panel_info.cmap=malloc(256 * NBITS(panel_info.vl_bpix) / 8);
+    gd->fb_base = msg_setup->allocate_buffer.body.resp.fb_address;
+    gd->fb_base &= ~0xc0000000;

I haven’t looked deep into this yet.

raspberry pi uboot references

>> making sd card for uboot


>> rpi boot process

>> device tree in rpi

>> general intro to device tree

>> config.txt of rspi



Maple Mini(STM32F103CBT6) USB example not working (not even recognized)

Using Maple Mini(STM32F103CBT6) here. I wanted to make a USB example work however, none of it seemed to work despite configuring the project build optimal for the chip.

I found that the reason behind why this didn’t work is because that the example project had different USB pull-up resistor GPIO pin connections compared to Maple Mini. Continue reading “Maple Mini(STM32F103CBT6) USB example not working (not even recognized)”

read/write in flash


current target: cypress PRoC module (chip: CYBL10563-56LQXI)

found which functions to use. however, in order to use them properly two things should be clarified.

  1. the flash structure for my module
  2. how to check the flash used by the application in order to avoid this region when doing read/write for my own.

workaround to write is introduced in [4].

method to read is suggested in [5] Continue reading “read/write in flash”