[NUCLEO-L476RG/STM32L476RGT6]Pin Association and DAC Error

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
ryo
Posts: 2
Joined: Thu May 03, 2018 6:53 am

[NUCLEO-L476RG/STM32L476RGT6]Pin Association and DAC Error

Post by ryo » Thu May 03, 2018 8:04 am

Hello.
I am a Japanese living in Japan.
Posted while being helped by Google translation.

I purchased NUCLEO-L476RG.

I downloaded the dfu file from the following URL.
http://micropython.org/resources/firmwa ... v1.9.3.dfu

After converting to hex file with DfuFileMgr.exe, we have written hex file to NUCLEO-L476RG with STM32 ST-LINK Utility.exe.
I connected the NUCLEO-L476RG to a PC via USB, and confirmed that the following code works correctly.
-----
>>> MicroPython v1.9.3 on 2017-11-01; NUCLEO-L476RG with STM32L476RG
Type "help()" for more information.
>>> print('hello')
hello
>>>
-----

I tried trying ADC and DAC as the next step, but I faced several problems.

1.I do not know the association between the name of the pin and the pin on the actual board. Is there a list or image somewhere?
2.An error occurred when trying to use the DAC. In this case, do I need to activate the DAC and recompile the dfu file?
In that case, which part should be changed?

-----
>>> import DAC
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'DAC'
>>>
>>> from pyb import DAC
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name DAC
>>>
----


I looked at various Web sites, but I could not find useful information.
(Although I am not good at English, it is one of the causes)

If the place to post is incorrect, please tell me the right place.
If I violate the forum rules, please tell me the bad things.

Thank you.

torwag
Posts: 202
Joined: Fri Dec 13, 2013 9:25 am

Re: [NUCLEO-L476RG/STM32L476RGT6]Pin Association and DAC Error

Post by torwag » Thu May 03, 2018 2:10 pm

Hi,

you might go to github to read in the source code files what is available and what is the pin assignment.

E.g.

https://github.com/micropython/micropyt ... LEO_L476RG

Each board has a pin.csv file which depicts the relation between the physical pins and the naming.

Within the source code files (mpconfigboard.h) you can also find, what kind of modules are ported to the platform etc.
E.g. In your case, I can't see that

MICROPY_HW_ENABLE_DAC is set
which most likely explain why you can't call the DAC functions.

Hope that is a good start.

ryo
Posts: 2
Joined: Thu May 03, 2018 6:53 am

Re: [NUCLEO-L476RG/STM32L476RGT6]Pin Association and DAC Error

Post by ryo » Sat May 05, 2018 12:43 pm

Hello.

>you might go to github to read in the source code files what is available and what is the pin assignment.

Thank you.
I was able to understand it.

>Within the source code files (mpconfigboard.h) you can also find, what kind of modules are ported to the platform etc.
>E.g. In your case, I can't see that

I see.
Certainly I could not find it, either.
Sorry, I will look for another way.

Thank you for answering.
It was very helpful.

Post Reply