U-Boot Application that can access all files on USB Flash Drive - u-boot

I just started learning about U-Boot and being able to write applications that can be run with U-Boot, so please be patient and if possible add more details to help me learn.
I wanted to ask for help, as I am trying to connect USB flash drive to my Arm Cortex A9 device. I want to be able to have access to all files on that drive through my U-Boot script. For example what I write will just run after U-Boot loads, and will be as simple as reading all files.
I plan to use U-Boot, so that I have access to all U-Boot drivers. U-boot supports USB, and I am able to see my USB Flash Drive on the U-boot command line. How can this be done, any help is HIGHLY appreciated please.

Related

Programming external QSPI flash Raspberry Pi Pico

I want to reprogram the external flash of a raspberry Pico via SWD line.
This feature must be implemented in a different microcontroller, not from a Linux computer so the OpenOCD library cannot be used.
I already wrote a C library that is able to read and write in RAM and in core registers via SWD and I'm able to put the Cortex-M0+ into halt state.
I read many tutorials and documentation and those that are useful are:
http://markding.github.io/swd_programing_sram/
https://www.silabs.com/documents/public/application-notes/an0062.pdf
https://community.silabs.com/s/article/how-to-program-internal-sram-over-swd?language=en_US
but unfortunately they aren't clear enough.
Can you explain the sequence of commands that I should send to RP2040 to correctly upload the new firmware?
Thanks for your help!

Beaglebone Black won't show-up as /dev/ttyUSB

I am trying to learn Linux by following instructions in "Mastering Embedded Linux Programming" by Chris Simmonds. By following the book and with some help from Stack_Overflow_1, i was able to build the MLO and u-boot.img.
However, when i connect USB cable to my PC and execute the ls /dev/tty* command, i cannot find any device with /dev/ttyUSB. All i can see are devices with /dev/tty0-63, /dev/ttyS0-31 and one /dev/ttyprintk.
Also, when i press down the S2 button and connect the USB cable, i can only see the power led glowing and nothing else.
I have properly built the u-boot (three attempts to get it right).
Also, as per the instructions in the book, i am only testing the u-boot stuff and yet to reach the kernal part.
If i remove the sd card and connect the USB, im an able to talk to my BBB over ssh (192.168.7.2).
How to i get the u-boot to work? Thank you!
If you don't have one yet, I'd recommend to get a USB-to-serial device (3.3V Vref). You connect it to the debug UART (J1) which is located next to the P9 side. Nowadays those are very cheap and can cost below 1$. Ones that feature a genuine FTDI part will be 5-10$ at least.
The serial port you are referencing is only available once the device has passed through U-Boot, booted the kernel and finally userspace has set up the communications.
Especially when working with U-Boot and the Kernel, low level UART access is crucial.
As a further note, could it be that the Book refers to the (white) original Beaglebone? That has a FTDI USB-to-UART chip on board and will allow you even U-Boot access. You can do the same things if you have the above mentioned USB device.
https://groups.google.com/g/beagleboard/c/eNDjK05spY8/m/GPvhcP52BAAJ shows that one needs to hold the space key to enter u-boot.
Also, the info. here might be more up to date compared to the book.
https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black
There is no way to copy and paste everything from the eewiki. I just left you the link. Enjoy!

USB driver for STM32l100rc using HAL library

Is there anyone who has worked on STM32L1 series. I'm working on STM32L1xx series and wanted to write USB driver for it. Is there any example for USB driver for STM32L series or anyone worked on STM32L1xx series? Any help will be appreciated.
Thanks in advance.
You need these works to do:
1.USB client driver on STM32. There are lots of available codes in github or other website;
2.SDcard driver. Normally SDCard has two modes, include SPI mode and SD mode, the operation will be simplified a lot in SPI mode, however, in SD mode the speed will more faster than SPI mode. you can refer to datasheet for more information.
Download STM32CubeMX
Download STM32CubeL1
Start new project for your device, choose peripheral, choose device class for MSC
Setup clock for USB
Export project
Configure SPI for your SDCARD (SDIO is not available) for interface between USB device stack and SDCARD sector read on PC demand.
This are key steps to do, as I don't know what you know so far (looks like nothing) and what you have learn yourself so far (looks like nothing) I'm unable to give you comprehensive answer.

How to connect on Nucleo with GDB?

I am using arm-none-eabi toolchain to create binary file for Nucleo which I then flash to the Nucleo using the USB virtual storage device it provides.
I am compiling the program with -ggdb. But how could I possibly connect to the nucleo and execute breakpoints on it? I can't even imagine how could it work, but I'm complete beginner.
Can I connect? How?
Yes you can connect, at least from a Linux host. I never tried from Windows system. Use OpenOCD to open a debug port and connect gdb (used arm-none-eabi-gdb) to this port with "gdb extended-remote" command. I am using this method from Linux host PC to connect to a custom board based on STM32L4 series for debugging and collecting log messages. Nucleo boards are also using the same series of STM controller.
For what it's worth there's a free IDE call EMBlocks that I've used in the past. I think the new version is called EMBitz https://www.embitz.org/
I've used it to both flash the STM32 Nucleo boards as well as debug the flashed image file.
A quick search also turns up this website that seems to indicate you can use GDB with the stlink utility. https://openenergymonitor.org/emon/node/6189

How to write a simple usb driver for a hardware copyright protection dongle?

I want to create a USB driver, so my own C application to be able to get into my flash drive and take information from the imported flash drive.
OS: Windows
I start my app contains my USB driver and I plug-in my flash and its shows in Explorer that this drive is plugged and it is accessible, while that's happening, my app is checking that file data.txt EXIST if that file exist, program run next function, if not program, my program runs down/exit/!
If you are looking for a programmable USB dongle, I suggest inspecting this SO thread: Programmable USB dongles
The Windows Driver Kit should simplify your work or atleast help you at the start.

Resources