[Solved]screen /dev/ttyACM0 on STM32L4R9IDISC

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
ndhuy
Posts: 32
Joined: Mon Nov 04, 2019 8:01 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by ndhuy » Wed Nov 13, 2019 10:22 am

Roberthh wrote:
Wed Nov 13, 2019 9:14 am
The support of USB devices by virtual machines is a different sad story. I consider it as simply unreliable. If it work - fine. If not, i cannot deduct anything from that.
Hi Roberthh,

Could you be more specific about your idea?

Did you mean that connecting virtual machine to STM32L4R9IDISC is harder if not say impossible than connecting to the actual Ubuntu (maybe by dual bootloader)?

User avatar
Roberthh
Posts: 2066
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by Roberthh » Wed Nov 13, 2019 12:05 pm

I would agree to your last statement. But my experience is more general about USB devices connected to virtual machines. And VMware supports USB better than VirtualBox. You could try to boot Linux from a live CD/DVD image to tell, whether that works better.

chrismas9
Posts: 148
Joined: Wed Jun 25, 2014 10:07 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by chrismas9 » Wed Nov 13, 2019 1:10 pm

The board has two USB connectors, one on top and one on bottom side. You will need two USB cables to get USB REPL to work. You need power into STlink port. It can be from phone charger or PC. The second cable must go from USB port labelled USB FS OTG to PC. You should then see. Virtual com port on your PC with REPL because USB is enabled in mpcongigboard.h

chrismas9
Posts: 148
Joined: Wed Jun 25, 2014 10:07 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by chrismas9 » Wed Nov 13, 2019 6:03 pm

Is MicroPython running? Hold the joystick button down and press reset. The green LED should count in flashes. One flash, two then three. Release the button after three flashes. It should reset the filesystem which will hold the LED one for one or two seconds.

ndhuy
Posts: 32
Joined: Mon Nov 04, 2019 8:01 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by ndhuy » Thu Nov 14, 2019 6:43 am

chrismas9 wrote:
Wed Nov 13, 2019 1:10 pm
The board has two USB connectors, one on top and one on bottom side. You will need two USB cables to get USB REPL to work. You need power into STlink port. It can be from phone charger or PC. The second cable must go from USB port labelled USB FS OTG to PC. You should then see. Virtual com port on your PC with REPL because USB is enabled in mpcongigboard.h

Hi chrismas9,

Sorry for replying late. I tried that way before: 2 cables: one for USB STLINK and one for OTG - FS. However, it did not work. I also changed the jumper at JP4 on the board but also, after screen /dev/ttyACM0, an uninsertable screen appeared. Or is there anything i should change, in both hardware and software, to make it works your way?

The uninsertable screen is below:

About the reset of holding joystick button down and reset button at the same time and waiting for 3 flashes from LED, i did that successfully on STM32F4 but my board STM32L4 did not work the same way. It even did not show any sign of respond even though the function of each button still goes well.

For your 2 recommended approaches above, i even went further and checked the the disc when i plugged in the L4. Unlike F4 which was successfully ported and could be written by MicroPython, the L4 Showed completely different files if not say lack 2 .py file. I am concerning and trying to figure that out.
Attachments
Capture.JPG
Capture.JPG (27.51 KiB) Viewed 782 times

ndhuy
Posts: 32
Joined: Mon Nov 04, 2019 8:01 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by ndhuy » Thu Nov 14, 2019 6:51 am

Roberthh wrote:
Wed Nov 13, 2019 12:05 pm
I would agree to your last statement. But my experience is more general about USB devices connected to virtual machines. And VMware supports USB better than VirtualBox. You could try to boot Linux from a live CD/DVD image to tell, whether that works better.
Hi Roberthh,

I think the problem is not from the connection between Ubuntu - virtual machine and the STM32L4. This is because as i check by typing "lsusb" into the terminal of Ubuntu - virtual machine, the screen showed that there was connection between them. You can see in the attached image below.

One of the obvious differences between successfully ported board and unsuccessful one was the difference in content of each disc when connecting F4 and L4 to the Ubuntu. L4 showed only 2 files which are completely different if not say lack .py file: boot.py and main.py

Is there anything i should concern about in both software and hardware?
Attachments
Capture1.JPG
Capture1.JPG (50.3 KiB) Viewed 776 times

chrismas9
Posts: 148
Joined: Wed Jun 25, 2014 10:07 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by chrismas9 » Fri Nov 15, 2019 2:21 am

If you can't get the green LED to flash you have a more fundamental problem than no REPL. I would review the driver and HAL interface changes you made for the MCU. On one port I did the interrupt vector table was different to most and I have also found the occassional bug in the STM32hal libraries.

I would also run STM32cubemx application from ST and set up the clock pins, then go to the clock page and run an auto tune. Some of the newer parts have more PLLs and you may find a peripheral that does not have its clock set up properly.

ndhuy
Posts: 32
Joined: Mon Nov 04, 2019 8:01 am

Re: screen /dev/ttyACM0 on STM32L4R9IDISC

Post by ndhuy » Fri Nov 15, 2019 8:53 am

chrismas9 wrote:
Fri Nov 15, 2019 2:21 am
If you can't get the green LED to flash you have a more fundamental problem than no REPL. I would review the driver and HAL interface changes you made for the MCU. On one port I did the interrupt vector table was different to most and I have also found the occassional bug in the STM32hal libraries.

I would also run STM32cubemx application from ST and set up the clock pins, then go to the clock page and run an auto tune. Some of the newer parts have more PLLs and you may find a peripheral that does not have its clock set up properly.
I agree with you. Probably, i have a bigger problem to concern about. I think I will check all the files I wrote and changes i made in library files. Using clocks is also a great idea to give it a go.

Thank you

Post Reply