Beginner setup of a nrf52840 dongle - nrf52

I bought a nordic nrf52840 dongle and I am trying to program it using the nRF connector. I have followed this tutorial https://electronut.in/nrf52840-thread/, and after I create the application.hex I need to flash it in the dongle. However when I try to write this new .hex I have the following error:
nrf-connector-error
I know that I need a bootloader and a SoftDevice, and that probably I need to merge them using some mergehex tool. I can't understand how to create this bootloader and SoftDevice.
Thanks!

To use nRF Connect with USB bootloader you have to shift your application RAM/FLASH regions. RAM should start at 0x20000008 and FLASH should start at 0x1000. That's all you have to do.

Related

STm32L4R5VG firmware upgrade in run time

In my application, I am using STm32L4R5VG as a host MCU. I want to upgrade the firmware of host MCU in run time over USB through the Android mobile app.
I have looked into USB DFU mode, but in that case, my device will enumerate as ST USB and also I need to enable the boot loader with boot pin.
In actuality, my device will connect with the Android mobile app using the CDC class device and enumerates as VCP. So I want to send the firmware file from Android mobile to host MCU over VCP and write into Bank2 of internal flash (as current code is in Bank1). Once the file transfer is done, the device will reboot on its own and check for the latest firmware and boots from Bank2.
I am stuck at how to write at bank2 securely during run time and perform self reset to boot from Bank2.
If anyone already worked on this or know about this then please guide me or point to the link where I can get details for this.

Raspberry PI ad-hoc configuration

I'm working on a project where i have two raspberry PI connected in ad-hoc mode. the project is for transmitting streaming data using UDP supported by a self developed ARQ protocol for reliable data transmission. the thing is that i want my 2 raspberry Pi to be synchronized! i tried to install the NTP server on one device and get the time on the other (as an NTP client) but when i wanted to reconnect them on ad hoc mode again, it was necessary to reboot the devices where the time was lost because the devices don't contain the hardware clock!
is there are any idea how to synchronize the two raspberry in ad-hoc mode ?
thank you!

How to debugging and flashing Nucleo32 board from TrueStudio?

I'm trying to flash my code to NUCLEO-L432KC(STM32L432KC) by TrueStudio. It was failed.
[
It looks tool cannot detect ST-Link probe. I just connected it by USB cable from PC (Windows10). Code and project file are generated by STM32CubeMX.
What is the missing? What should I do?
I have confirmed following.
From STM32CubeProgrammer GUI, it cannot detect ST-Link connection.
From STM32CubeProgrammer CLI, it can detect S/N of ST-Link. But cannot connect.
From STLinkUpgrade 3.3.0, it can detect device and S/N. Also can update to V2J33M25.
From IAR Embedded Workbench, it can build and flash code and debug. No problem at all.
It looks same result using by STM32F4 Discovery kit for STM32F429 MCU.
Make sure you don't have another program such as ST-LINK utility running while you use the debugger. Some versions of the ST-LINK "hogs" the debug pod access and other programs then would have trouble connecting to it.
Install the drivers https://www.st.com/en/development-tools/stsw-link009.html
Choose the correct micro in the debug configuration window

"No ST-LINK detected" error message, when trying to connect with ST-LINK Utility

I have a
NUCLEO-F401RE board
(with STM32F401RE)
and it has been working fine for the most part. Here recently, I followed a tutorial in the book
"Mastering STM32"
where it says to install
OpenOCD.
I had been following along before this as well, and I had been able to connect to my board and flashing it with no problem.
After attempting to get OpenOCD to work though, this is no longer possible. Every time I try to connect to my board, I simply get the following error message:
No ST-LINK detected
I have tried updating the drivers multiple times, rebooting the board, reinstalling the ST-LINK Utility, switching the USB-Cable, resetting the board and reinstalling everything and I have also tried the trick where you hold down the reset button and try to erase the chip.
So far, none of this has worked for me unfortunately.
Here you find a picture of my board.
On my desktop, I am using Windows 10. On my board, and I am using FreeRTOS.
Here you find an image of my Windows Device Manager.
I have also tried to update the firmware on my board using the ST-Link upgrade, but without luck. When attempting this, I either do not have the option to select my device (when using the .jar app) or when using the .exe app, I just get the following error messages:
No ST-Link device detected
Please connect it and then retry
I have not been able to find a solution for this anywhere, so I hope you guys can help! If you need any further relevant information, just let me know. Thank you very much.
As mentioned in other answers, the problem is almost certainly due to a competing driver (something like libusb) taking control of the device.
However, you do not need to "uninstall and reinstall everything" to select the correct driver, assuming that you have already installed it once before. Moreover, the reinstallation procedure most likely won't help, because the uninstallers usually do not uninstall the drivers anyway, and Windows will keep prefering the same wrong driver.
Instead, open Device Manager, find your STM32 STLink device, double-click to open the Properties dialog. Then click "Update Driver", then "Browse my computer for driver software", then "Let me pick from a list of available drivers on my computer", and you should see something like that:
You see that in this example, at least four different drivers available on the system are happy to service the device. The first two are generic libusb drivers, not specific to the dongle (OpenOCD is happy to use either of those, if I remember correctly). The ST-Link utility, however, wants a dedicated driver, developed by STM - those are the two entries below on my picture. If you do not see those, try installing the ST-Link utility again (no need to uninstall anything) or download just the driver from the STM website.
You can now click on the preferred driver in this list and have it replace whatever driver was assigned to the device before.
From my poor experience the "No ST-LINK detected" message in the STM32 Utility shows when you are disconnected or when other program is using a ST-LINK. So, if this start happens after installing OpenOCD try to uninstall this and try again (maybe with option "Connect under reset"?).
For your information. When you plug the cable to the PC and the board is power on then in the settings (STM32 Utility) you can see available ST-Links (even blocked). Here is example when ST-Link is blocked
From what I have learned and understood (but everyone can correct me :)), your board is divided in two parts :
The ST-Link debugger part ;
The rest with the actual microcontroller.
The ST-Link part is used to flash the microcontroller and can be used to flash any other STM32F4 device through SWD. With your picture :
The STM32 ST-Link Utility uses the ST-Link part of your board to flash it. My point is that if you have the "No ST-Link detected", the issue, I am quite sure, doesn't come from the microcontroller part but comes from the ST-Link part. And since you did say that it worked before you install openocd, I would suggest the driver part in W10 that may be the root of your problems.
Try to uninstall everything (and I mean everything) related to the STM32 (openocd, STM32 ST-Link Utility and its driver through Device Manager).
Reinstall only STM32 ST-Link utility (if you did uninstall the drivers correctly, it should ask you the permission to install the drivers during set up) and try to connect your board.
You can also try to remove the SWD jumpers (connector CN2) on your board to detach the ST-Link from the built-in microcontroller part. Since the ST-Link part is independent it will still be detected by the STM32 ST-Link Utility (but you will have to put the jumpers back if you want to actually program your microcontroller).
Just ran into this. The problem boiled down to using nucleo boards and trying to interface with them using older versions of ST-LINK (ST's search for ST-Link's first hit led me to stsw-link0004, which was not installing the right drivers). Why they don't point you to the latest greatest first, who knows.
Whenever I tried to install drivers, I could only select USB Composite device as a compatible driver, despite repeatedly uninstalling/reinstalling stlink0004.
You need to install the newest st-link e.g. stsw-link0009 (or newer).
Uninstall device (device manager had it under USB Composite Device)
Uninstall ST-LINK
Disconnect nucleo.
Reboot.
Install ST-link (stsw-link0009)
The prompt should have you install 3+ drivers. Not just 2.
Plug in. Voila.

How to connect TWO android devices to a pc via USB

I wrote an app which runs on two android tablets at the same time. The app enables both devices to communicate with a java server which is running on the pc, via WLAN socket communication.
The problem with the WLAN connection is that it doesn't always seem to be reliable. So I wanted to setup a socket communication to the server via USB cables.
My problem no is how to connect TWO android devices to the server via USB cables. I found this tutorial for connecting ONE device to the server via ADB, but I see no possibility using this approach for two devices:
http://www.anothem.net/archives/2010/10/15/android-usb-connection-to-pc/
Has anyone an idea how to solve it? Thanks!
If your tablet is runs ICS or newer Android OS, then it is very likely that it has OTG capable micro-USB socket, and you can add a USB-Ethernet dongle, and then connect the 2 tablets to your PC over ethernet, instead of USB. This, might be the most elegant solution.
Of course, you'd need a switch (or hub) to connect them together. Also note that, not all USB-Ethernet dongles may work out-of-the-box. You might have to experiment with few models, especially the el-cheapo ones to get them to work.