Re: [beagleboard] Re: How to flash the eMMC on BBB

2020-06-03 Thread Szymon Kempny
Hi Jason,

thak you for your sugesstions. I finally found what i'm doing wrong.

I need to set ENV_FAT_DEVICE_AND_PART to 1:1 in uboot-menuconfig.

Then system finally start from internal eMMC memory.


W dniu środa, 3 czerwca 2020 13:41:56 UTC+2 użytkownik Jason Kridner 
napisał:
>
>
>
> On Jun 2, 2020, at 7:40 PM, Szymon Kempny > 
> wrote:
>
> Yes, of course:
>
>
> => printenv
>> arch=arm
>> args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} 
>> root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
>> baudrate=115200
>> board=am335x
>> board_name=A335BNLT
>> board_rev=00C0
>> board_serial=4819BBBK12B5
>> boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} 
>> ${prefix}${script}; source ${scriptaddr}
>> boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr 
>> ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} 
>> ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt 
>> addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else 
>> bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
>> boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any 
>> ${scriptaddr} ${prefix}${boot_syslinux_conf}
>> boot_fdt=try
>> boot_fit=0
>> boot_net_usb_start=usb start
>> boot_prefixes=/ /boot/
>> boot_script_dhcp=boot.scr.uimg
>> boot_scripts=boot.scr.uimg boot.scr
>> boot_syslinux_conf=extlinux/extlinux.conf
>> boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp
>> bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit; fi; run 
>> findfdt; run init_console; run envboot; run distro_bootcmd
>> bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} 
>> ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile 
>> ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile 
>> ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv 
>> efi_old_arch ${bootp_arch};setenv bootp_vci 
>> PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp 
>> ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt 
>> addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else 
>> bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci 
>> ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv 
>> efi_old_arch;setenv efi_old_vci;
>> bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
>> bootcmd_legacy_mmc1=setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot
>> bootcmd_mmc0=devnum=0; run mmc_boot
>> bootcmd_mmc1=devnum=1; run mmc_boot
>> bootcmd_nand=run nandboot
>> bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
>> bootcount=7
>> bootdelay=0
>> bootdir=/boot
>> bootenvfile=uEnv.txt
>> bootfile=zImage
>> bootm_size=0x1000
>> bootpart=1:2
>> bootscript=echo Running bootscript from mmc${mmcdev} ...; source 
>> ${loadaddr}
>> console=ttyO0,115200n8
>> cpu=armv7
>> devnum=1
>> devtype=mmc
>> dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO 
>> fat 1 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw 
>> raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 
>> 0x1700 0x6900;spl-os-args fat 1 1;spl-os-image fat 1 1;u-boot.img fat 1 
>> 1;uEnv.txt fat 1 1
>> dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 
>> 0x100 0x100;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 
>> 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 
>> 0x6900;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt 
>> fat 0 1
>> dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 
>> 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 
>> 8;rootfs part 0 9
>> dfu_alt_info_ram=kernel ram 0x8020 0x400;fdt ram 0x80f8 
>> 0x8;ramdisk ram 0x8100 0x400
>> distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; 
>> done
>> efi_dtb_prefixes=/ /dtb/ /dtb/current/
>> envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on 
>> device ${mmcdev};if run loadbootscript; then run bootscript;else if run 
>> loadbootenv; then echo Loaded env from ${bootenvfile};run 
>> importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run 
>> uenvcmd;fi;fi;fi;
>> eth1addr=0c:b2:b7:cd:44:35
>> ethact=ethernet@4a10
>> ethaddr=0c:b2:b7:cd:44:33
>> fdt_addr_r=0x8

Re: [beagleboard] Re: How to flash the eMMC on BBB

2020-06-02 Thread Szymon Kempny
echo Found 
> U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: 
> continuing...; fi; done
> scriptaddr=0x8000
> serial#=4819BBBK12B5
> soc=am33xx
> spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} 
> rootfstype=${spirootfstype}
> spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf 
> read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
> spibusno=0
> spiimgsize=0x362000
> spiroot=/dev/mtdblock4 rw
> spirootfstype=jffs2
> spisrcaddr=0xe
> static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
> stderr=serial@44e09000
> stdin=serial@44e09000
> stdout=serial@44e09000
> update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile 
> ${fit_bootfile}
> usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run 
> scan_dev_for_boot_part; fi
> usbnet_devaddr=de:ad:be:ef:00:01
> vendor=ti
> ver=U-Boot 2019.07 (Jun 02 2020 - 16:55:38 +0200)
> Environment size: 9845/131068 bytes



W dniu wtorek, 2 czerwca 2020 17:56:38 UTC+2 użytkownik Jason Kridner 
napisał:
>
> Can you stop the boot in u-boot and print the environment? There's 
> probably an easy fix to the bootcmd.
>
> On Tue, Jun 2, 2020 at 11:50 AM Szymon Kempny  > wrote:
>
>> It looks like the eMMC is properly recognized by uBoot:
>>
>> => mmcinfo
>>> Device: OMAP SD/MMC
>>> Manufacturer ID: 70
>>> OEM: 100
>>> Name: M6270
>>> Bus Speed: 4800
>>> Mode: MMC High Speed (52MHz)
>>> Rd Block Len: 512
>>> MMC version 5.1
>>> High Capacity: Yes
>>> Capacity: 3.6 GiB
>>> Bus Width: 8-bit
>>> Erase Group Size: 512 KiB
>>> User Capacity: 3.6 GiB
>>> Boot Capacity: 2 MiB ENH
>>> RPMB Capacity: 512 KiB ENH
>>
>>
>> -- 
>> For more options, visit http://beagleboard.org/discuss
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to beagl...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beagleboard/03673c3f-8769-4c0b-bce0-d231eb1555db%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/beagleboard/03673c3f-8769-4c0b-bce0-d231eb1555db%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/a396d415-4b59-4a41-a681-81438cc78615%40googlegroups.com.


[beagleboard] Re: How to flash the eMMC on BBB

2020-06-02 Thread Szymon Kempny
It looks like the eMMC is properly recognized by uBoot:

=> mmcinfo
> Device: OMAP SD/MMC
> Manufacturer ID: 70
> OEM: 100
> Name: M6270
> Bus Speed: 4800
> Mode: MMC High Speed (52MHz)
> Rd Block Len: 512
> MMC version 5.1
> High Capacity: Yes
> Capacity: 3.6 GiB
> Bus Width: 8-bit
> Erase Group Size: 512 KiB
> User Capacity: 3.6 GiB
> Boot Capacity: 2 MiB ENH
> RPMB Capacity: 512 KiB ENH


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/03673c3f-8769-4c0b-bce0-d231eb1555db%40googlegroups.com.


[beagleboard] How to flash the eMMC on BBB

2020-06-02 Thread Szymon Kempny
Hello,

how to flash system image created by buildroot to internal eMMC memory in 
BBB?

Here is what I'm doing:

1. Build image with buildroot
2. Write sdcard.img to SD card
3. Boot BBB from SD card
4. Increase root partition on SD card: resize2fs /dev/mmcblk0p2
5. scp sdcard.img from PC to BBB: scp output/images/sdcard.img 
root@192.168.1.213:/root/
6. Boot BBB from SD card
7. Write sdcard.img to internal eMMC od BBB: dd if=sdcard.img 
of=/dev/mmcblk1
8. Poweroff BBB
9. Remove SD card from BBB
10. Power on BBB.

Here is the output from console:

U-Boot SPL 2019.07 (Jun 02 2020 - 16:55:38 +0200)
> Trying to boot from MMC2
>
> U-Boot 2019.07 (Jun 02 2020 - 16:55:38 +0200)
> CPU  : AM335X-GP rev 2.1
> Model: TI AM335x BeagleBone Black
> DRAM:  512 MiB
> NAND:  0 MiB
> MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> Loading Environment from FAT...  not set. Validating first E-fuse 
> MAC
> Net:   eth0: ethernet@4a10
> Warning: usb_ether MAC addresses don't match:
> Address in ROM is  de:ad:be:ef:00:01
> Address in environment is  0c:b2:b7:cd:44:35
> , eth1: usb_ether
> Hit any key to stop autoboot:  0
> switch to partitions #0, OK
> mmc1(part 0) is current device
> SD/MMC found on device 1
> ## Error: "bootcmd_nand0" not defined
> starting USB...
> Bus usb@47401800: Port not available.
> ethernet@4a10 Waiting for PHY auto negotiation to complete... done
> link up on port 0, speed 100, full duplex
> BOOTP broadcast 1
> DHCP client bound to address 192.168.1.213 (6 ms)
> Using ethernet@4a10 device
> TFTP from server 192.168.1.1; our IP address is 192.168.1.213
> Filename 'zImage'.
> Load address: 0x8200
> Loading: T



What should I fix to properly run my BBB from eMMC?


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/7cf87e6c-8df7-40e2-beb4-6381329c3275%40googlegroups.com.


Re: [beagleboard] [buildroot] Enable power button in BBB

2020-05-21 Thread Szymon Kempny
Thanks for quick response.
Im using Busybox, but i can try build with systemd tomorrow.

Is there a quick way to overwrite power off sequence using busybox to make 
it work correctly?

Working power button isn't nesesery im my case.


W dniu piątek, 22 maja 2020 03:21:06 UTC+2 użytkownik RobertCNelson napisał:
>
> On Thu, May 21, 2020 at 7:06 PM Szymon Kempny  > wrote: 
> > 
> > How to enable power button in Beaglebone Black Rev C? 
> > Here is my device tree from i2c and tps: 
> > 
> > i2c0_pins: pinmux_i2c0_pins { 
> >pinctrl-single,pins = < 
> >AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)   /* 
> i2c0_sda.i2c0_sda */ 
> >AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)   /* 
> i2c0_scl.i2c0_scl */ 
> >>; 
> >}; 
> > 
> >  { 
> >pinctrl-names = "default"; 
> >pinctrl-0 = <_pins>; 
> > 
> > status = "okay"; 
> >clock-frequency = <40>; 
> > 
> > tps: tps@24 { 
> >reg = <0x24>; 
> >}; 
> > 
> > baseboard_eeprom: baseboard_eeprom@50 { 
> >compatible = "atmel,24c256"; 
> >reg = <0x50>; 
> > 
> > #address-cells = <1>; 
> >#size-cells = <1>; 
> >baseboard_data: baseboard_data@0 { 
> >reg = <0 0x100>; 
> >}; 
> >}; 
> > }; 
> > 
> >  { 
> >/* 
> > * Configure pmic to enter OFF-state instead of SLEEP-state 
> ("RTC-only 
> > * mode") at poweroff.  Most BeagleBone versions do not support 
> RTC-only 
> > * mode and risk hardware damage if this mode is entered. 
> > * 
> > * For details, see linux-omap mailing list May 2015 thread 
> > *  [PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller 
> > * In particular, messages: 
> > *  http://www.spinics.net/lists/linux-omap/msg118585.html 
> > *  http://www.spinics.net/lists/linux-omap/msg118615.html 
> > * 
> > * You can override this later with 
> > *   {  /delete-property/ ti,pmic-shutdown-controller;  } 
> > * if you want to use RTC-only mode and made sure you are not 
> affected 
> > * by the hardware problems. (Tip: double-check by performing a 
> current 
> > * measurement after shutdown: it should be less than 1 mA.) 
> > */ 
> > 
> > interrupts = <7>; /* NMI */ 
> >interrupt-parent = <>; 
> > 
> > ti,pmic-shutdown-controller; 
> > 
> > charger { 
> >status = "okay"; 
> >}; 
> > 
> > pwrbutton { 
> >status = "okay"; 
> >}; 
> > 
> > regulators { 
> >dcdc1_reg: regulator@0 { 
> >regulator-name = "vdds_dpr"; 
> >regulator-always-on; 
> >}; 
> > 
> > dcdc2_reg: regulator@1 { 
> >/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance 
> */ 
> >regulator-name = "vdd_mpu"; 
> >regulator-min-microvolt = <925000>; 
> >regulator-max-microvolt = <1351500>; 
> >regulator-boot-on; 
> >regulator-always-on; 
> >}; 
> > 
> > dcdc3_reg: regulator@2 { 
> >/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance 
> */ 
> >regulator-name = "vdd_core"; 
> >regulator-min-microvolt = <925000>; 
> >regulator-max-microvolt = <115>; 
> >regulator-boot-on; 
> >regulator-always-on; 
> >}; 
> > 
> > ldo1_reg: regulator@3 { 
> >regulator-name = "vio,vrtc,vdds"; 
> >regulator-always-on; 
> >}; 
> > 
> > ldo2_reg: regulator@4 { 
> >regulator-name = "vdd_3v3aux"; 
> >regulator-always-on; 
> >}; 
> > 
> > ldo3_reg: regulator@5 { 
> >regulator-name = "vdd_1v8"; 
> >regulator-always-on; 
> >}; 
> > 
> > ldo4_reg: regulator@6 { 
> >regulator-name = "vdd_3v3a"; 
> >regulator-always-on; 
> >}; 
> >}; 
> > }; 
> > 
> > Im using kernel 4.19.79 
> > 
> > On default Debian image: 
> > - when i press power bu

[beagleboard] [buildroot] Enable power button in BBB

2020-05-21 Thread Szymon Kempny
How to enable power button in Beaglebone Black Rev C?
Here is my device tree from i2c and tps:

i2c0_pins: pinmux_i2c0_pins {
   pinctrl-single,pins = <
   AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)   /* 
i2c0_sda.i2c0_sda */
   AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)   /* 
i2c0_scl.i2c0_scl */
   >;
   };

 {
   pinctrl-names = "default";
   pinctrl-0 = <_pins>;

status = "okay";
   clock-frequency = <40>;

tps: tps@24 {
   reg = <0x24>;
   };

baseboard_eeprom: baseboard_eeprom@50 {
   compatible = "atmel,24c256";
   reg = <0x50>;

#address-cells = <1>;
   #size-cells = <1>;
   baseboard_data: baseboard_data@0 {
   reg = <0 0x100>;
   };
   };
};

 {
   /*
* Configure pmic to enter OFF-state instead of SLEEP-state ("RTC-only
* mode") at poweroff.  Most BeagleBone versions do not support RTC-only
* mode and risk hardware damage if this mode is entered.
*
* For details, see linux-omap mailing list May 2015 thread
*  [PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller
* In particular, messages:
*  http://www.spinics.net/lists/linux-omap/msg118585.html
*  http://www.spinics.net/lists/linux-omap/msg118615.html
*
* You can override this later with
*   {  /delete-property/ ti,pmic-shutdown-controller;  }
* if you want to use RTC-only mode and made sure you are not affected
* by the hardware problems. (Tip: double-check by performing a current
* measurement after shutdown: it should be less than 1 mA.)
*/

interrupts = <7>; /* NMI */
   interrupt-parent = <>;

ti,pmic-shutdown-controller;

charger {
   status = "okay";
   };

pwrbutton {
   status = "okay";
   };

regulators {
   dcdc1_reg: regulator@0 {
   regulator-name = "vdds_dpr";
   regulator-always-on;
   };

dcdc2_reg: regulator@1 {
   /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
   regulator-name = "vdd_mpu";
   regulator-min-microvolt = <925000>;
   regulator-max-microvolt = <1351500>;
   regulator-boot-on;
   regulator-always-on;
   };

dcdc3_reg: regulator@2 {
   /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
   regulator-name = "vdd_core";
   regulator-min-microvolt = <925000>;
   regulator-max-microvolt = <115>;
   regulator-boot-on;
   regulator-always-on;
   };

ldo1_reg: regulator@3 {
   regulator-name = "vio,vrtc,vdds";
   regulator-always-on;
   };

ldo2_reg: regulator@4 {
   regulator-name = "vdd_3v3aux";
   regulator-always-on;
   };

ldo3_reg: regulator@5 {
   regulator-name = "vdd_1v8";
   regulator-always-on;
   };

ldo4_reg: regulator@6 {
   regulator-name = "vdd_3v3a";
   regulator-always-on;
   };
   };
};

Im using kernel 4.19.79

On default Debian image:
- when i press power button then the system is power off and power LED is 
off
- when i run `poweroff` then system is going down and power led is OFF

On my buildroot image:
- when i press power button nothing happend
- when i run `poweroff` then system is going down and power led is still ON

How to enable full power support in buildroot image?

Regards,
Szymon
 

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/7692613b-7550-4380-83d6-2ae7e1d10884%40googlegroups.com.


[beagleboard] BeagleBone Black and Buildroot with CAN and power support

2020-05-16 Thread Szymon Kempny
Hello,

For w few days i try to build Linux image with Buildroot which support CAN0 
and CAN1 interface. I successfully use those interfaces with Debian image 
provided by BeagleBone.org, but this official image has a lot of stuff 
which i don't need and also has a very long booting time.

I build image with buildroot doing the following steps:

1. 
$ wget https://buildroot.org/downloads/buildroot-2020.02.2.tar.gz

$ tar zxvf buildroot-2020.02.2.tar.gz

$ cd buildroot-2020.02.2

$ make beaglebone_defconfig

$ make menuconfig

Doing basic configuration enable glibc, iproute2 and libsocketcan.

$ make can-utils

$ make haveged

$ make


2.
Write sdcard.img to SD Card and boot BBB from this card.

3.
Login into system by debugger port.

4.
$ modprobe can

$ modprobe can-raw

$ modprobe can-dev

$ ip a

//There is only lo, eth0 and sit0 interfaces.

How to add support for CAN interface?


Another issue is that when i type poweroff command, system is powering 
down, but the power LED is ON and pressing power button is not working. 
Only pressing reboot buton effect power on system. How to make it working 
properly? 


Regards,
Szymon

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/5de1679e-d4b5-40fe-ba82-af0c78057d13%40googlegroups.com.