How to flash NUCLEO F401RE with command line - node.js

I am looking for a command line tool for flashing my NUCLEO card in ubuntu. I want this tools for flash my NUCLEO remotely with node.js. I already try st-flash and stm32flash but these tools don't work properly. My programs are generated by mbed online tool.
Do you have any suggestions ?
Thanks for your answers

You can update Nucleo boards simply by copying the mbed image to the mass storage device presented when you connect to the composite USB interface.
The image file is automatically written to the microcontroller flash by the integrated STLink device when the file is placed on the USB drive. This is a "write-only" device; the written file cannot be read back - if you interrogate the drive it always appears empty.
In Ubuntu you may have to explicitly mount the device. If it mounts automatically it will appear under /mnt (I guess).
Since it is a standard USB mass storage interface, you should not need any Nucleo or ST specific driver or software. It is a "drag & drop" programming interface.
If your board does not appear as a mass storage device, you may need to update the integrated STLink firmware as described at https://os.mbed.com/teams/ST-Americas-mbed-Team/wiki/Preparing-the-STM32-Nucleo-Board

Related

How to convert a pen drive to a dongle?

I have a desktop application I've written in c#. I only want users with a license dongle to be able to use the software. I checked, there are companies that provide this facility but I find them expensive.
Is there a way I can turn an old pendrive into a dongle so it doesn't show in the file explorer, but the software can read from it ??
This is not possible with a normal pendrive. You would have to change the firmware of the pendrive controller.

How can BeagleBone Black be used as Mass Storage Device?

Is it possible to use the BB as Mass Storage Device?
I want it to be connected to an audio player that can read files from USB connectivity (such as USB flash drive) and act as data storage device containing one specific folder (and its sub-folders) from the file system (if possible, on a flash drive connected to the board.).
As the device specs says, it has connectivity of:
USB client for power & communications
USB host
Operating system will probably be Ubuntu but can be changed.
What drivers or configurations needs to be done in order to achieve this?
The latest images have already the mass storage usb gadget active, so a mass storage peripheral should be recognized by your system upon connection.
A quick google search reveals this discussion about a user trying to disable the USB MS gadget:
From the discussion, the files where the magic happens are:
Debian: /opt/scripts/boot/am335x_evm.sh
Ubuntu: /opt/scripts/boot/am335*
Armstrong: /usr/bin/g-ether-load.sh
In my Debian image the line you want to modify is:
modprobe g_multi file=${gadget_partition} cdrom=0 stall=0 removable=1 nofua=1 iSerialNumber=${SERIAL_NUMBER} iManufacturer=Circuitco iProduct=BeagleBone${BLACK} host_addr=${cpsw_1_mac}
and the corresponding $gadget_partition variable that is set just before that in order to customize the folder you want to expose.
Note that the g_multi gadget in its standard configuration presents 3 different devices: an ethernet interface, a mass storage peripheral and a serial interface. If you want to customize the parameters you can refer to the g_multi documentation (kernel.org)

Do i need motherboard for NRF51822 BLE UART?

I'm working on the iOS app to interact with Arduino boards. On Arduino side i use "transparent" serial implemented in HM-10/11 firmware. So i just wire HM-10/11 RT/TX pins with Arduino ones and it works just perfect and write to specific characteristic to send data and subscribe/read to some specific to read from BLE module. No need to use any SDK or BLE library in arduino sketch, no need to modify bootloader.
Now i need to support NRF51822 BLE chips. Nordic has implemented UART serial in firmware sources but for my NRF51822 board (purchased on ebay) it's not uploaded to the chip by default as i can't see 0001 service and 0002 and 0003 characteristics. Do i need to purchase NRF motherboard and compile and upload this firmware? Can i do it without purchasing this dev kit? Can i upload over USB only or over BLE too?
If your are using NRF51822 standalone module ,then to update its firmware through SWIO/SWCLK pins ,you need a compatible JTAG programmer/debugger (you can check in segger website) . You can use Keil IDE to upload your updated firm ware to the flash memory of NRF51822 .
Although you need to upload using a SWD programmer, you are not limited to Segger.
There are open source alternatives like the Black Magic Proble which you can flash into $5 hardware (stm32f103 boards) from ebay.
You are also not limited to Keil or IAR for your compiler toolchain.
Its possible to compile using Eclipse and GCC ( Nordic have a blog entry in how setup an Eclipse base dev environment)
You can even program these devices using the Arduino IDE.
It is possible to upload OTA, but you would need to flash an OTA bootloader onto the device first using SWD and even then, you would probably need to upload via a mobile phone, as Im not aware of any PC ble devices that support transfer via the DFU protocol ( though some may exist)
These devices do not natively support USB.
Some boards using these device have a separate processor that allows upload as if the chip was a mass storage device, but I am not aware of a motherboard into which you could plug this module, which has that functionality.
BTW. The module you linked to, is actually designed and manufactured by Waveshare.com . Take a look at their website, it has full documentation on the hardware including schematics
The nRF51 and nRF52 dev boards has an onboard Segger / JLink. So then you can develop on and debug on the nRF51822 and flash other nRF51822s as well.

Linux Virtual USB device driver

My goal is to create a virtual USB char device (not block device) for Linux 2.6.32 and above (I use debian squeeze) that would be recognize by the system.
I would like that this device be listed with lsusb as a normal USB device, and that every application could use libusb in order to open the device, and send control message, and make bulk write/read. But behind this virtual device, it's behavior would be set by my application. I want to set it's product ID, it's vendor ID, answer to USB status, and bulk read.
I've read some posts about how to use USB/IP in order to create a virtual USB device, and that's exactly what I want to do
Installation and emulation of virtual USB Device
http://breaking-the-system.blogspot.fr/2014/08/emulating-usb-devices-in-python-with-no.html
But unfortunately, when I tried with 2.6.32 kernel and above, I didn't succeed making it work. So I looked at how to create a kernel module that would create the virtual device :
http://pete.akeo.ie/2011/08/writing-linux-device-driver-for-kernels.html
This one looks great also, but the sample provided doest not indicate how to make it an USB device.
I've seen some post talking about it with windows but none that could help me with Linux.
I would like to avoid buying some USB programmable cards when it can be done with software.
Have anyone any leads on how to make the first methods works under newer kernel, or convert the sample code of the second method for making an USB device ?
I have fixed the code of http://breaking-the-system.blogspot.fr/2014/08/emulating-usb-devices-in-python-with-no.html (first method using USB/IP) to work with linux 4.3.
In the original code are missing USB requests like set configuration and get status. Without the implementation of all USB requests used for the OS driver the code will not work.
The fixed code can be downloaded in https://github.com/lcgamboa/USB-Emulation .
I guess raw-gadget kernel module is the thing that you want?
you can check the dummy_hcd and tests directory inside the repo, it will guide you how to create a virtual USB device

How to use USB GPRS Modem on ARM - Windows CE 6.0?

I've been involved with a project where I have to install and use a USB GPRS modem on an ARM board (RSC-W910) with Windows CE 6.0 installed.
The modem is the Sierra Wireless product GL6110 (GL61x0) and I need to use it only for data, making HttpWebRequests (TCP) send/receive XML data. Prefered development tool is C# and .Net Framework 3.5.
When the modem is connected via USB to the board, the error message that appears is saying "Unidentified USB Device" which I believe its normal.
Siera Wireless(SW) provides a driver for ARM920, but it failed to install using 'wceload.exe'. The error was "Setup Failed" that I could see on the small LCD screen attached to the board. To install the driver I connect to the board via Telenet and CAB file is stored on SD card.
Am I right to think that the failure to install the driver could be related to the fact that the Win CE image has RAM-based Registry?
If SW does not provide a driver for the modem, could this mean that I have to develop my own driver? or is there a generic driver that I can use instead?
Will I have to create a new Win CE image for the board to support the modem, or is it possible to use code within the C# application to access it?
Any help will be very much appreciated!
Thanks,
Nick
There's no generic driver, no. Sierra modems generally have CE support (I'm not checked this model, but it's likely to work). What you need is:
A Driver DLL, build for ARM and for CE 6.0 or 7.0 (the CE 5.0 driver model differs, so a CE 5.0 driver probably won't work)
The registry entries the device.exe looks for when the device is enumerated
These sometime come in a CAB, sometimes not. Generally I prefer it when they don't but either will work.
If the CAB file fails to install, it's probably because it's marked for some other platform. I'd use something like WinZip or WinRAR to pull it apart, rename the DLL and extract the necessary reg entries (depends on the CAB format how easy/hard this will be).
Generally, though, you need to copy the driver DLL to the \Windows Folder, then apply the registry entries. Then when the device is plugged in, it will read the registry, which will point it to the DLL, which is then loaded. "Unidentified USB device" typically means the registry entries were not found.
This can all be done without rolling a new OS image, though sometimes a new image is simpler than doing the necessary copying at startup, especially if the device is plugged in at boot.

Resources