I have purchased a Nucleo-L476RG, and I’ve tried to unzip arduino-STM32L4 and Arduino_Core_STM32L4 in the hardware folder in my Arduino folder.
https://github.com/GrumpyOldPizza/arduino-STM32L4
https://github.com/stm32duino/Arduino_Core_STM32L4
I am on MacOS 10.12.1 and Arduino 1.6.13, but, I can’t see anything on the board section.
Do you have any idea on how to fix this ?
Thanks
Please do not cross post.
Also as this is @grumpyoldpizza’s core you may need to PM him about it, as its not something that I manage
Please do not cross post.
Also as this is @grumpyoldpizza’s core you may need to PM him about it, as its not something that I manage
void DMA1_Channel1_Handler(void)
void DMA1_Channel1_IRQnHandler(void)
void HAL_DMA_IRQHandler(void)
nether works. I set up dma in conjunction with adc, and I know it is working in “manual” mode till half transfer interrupt has to be called, after that nucleo hangs up.
DMA settings:
void Configure_DMA(void)
{
NVIC_SetPriority(DMA1_Channel1_IRQn, 1); /* DMA IRQ lower priority than ADC IRQ */
NVIC_EnableIRQ(DMA1_Channel1_IRQn);
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_DMA1);
LL_DMA_ConfigTransfer(DMA1,
LL_DMA_CHANNEL_1,
LL_DMA_DIRECTION_PERIPH_TO_MEMORY |
LL_DMA_MODE_CIRCULAR |
LL_DMA_PERIPH_NOINCREMENT |
LL_DMA_MEMORY_INCREMENT |
LL_DMA_PDATAALIGN_HALFWORD |
LL_DMA_MDATAALIGN_HALFWORD |
LL_DMA_PRIORITY_HIGH );
/* Select ADC as DMA transfer request */
LL_DMA_SetPeriphRequest(DMA1,
LL_DMA_CHANNEL_1,
LL_DMA_REQUEST_0);
/* Set DMA transfer addresses of source and destination */
LL_DMA_ConfigAddresses(DMA1,
LL_DMA_CHANNEL_1,
LL_ADC_DMA_GetRegAddr(ADC1, LL_ADC_DMA_REG_REGULAR_DATA),
(uint32_t)&aADCxConvertedData,
LL_DMA_DIRECTION_PERIPH_TO_MEMORY);
/* Set DMA transfer size */
LL_DMA_SetDataLength(DMA1,
LL_DMA_CHANNEL_1,
ADC_CONVERTED_DATA_BUFFER_SIZE);
/* Enable DMA transfer interruption: transfer complete */
LL_DMA_EnableIT_TC(DMA1,
LL_DMA_CHANNEL_1);
/* Enable DMA transfer interruption: half transfer */
LL_DMA_EnableIT_HT(DMA1,
LL_DMA_CHANNEL_1);
/* Enable DMA transfer interruption: transfer error */
LL_DMA_EnableIT_TE(DMA1,
LL_DMA_CHANNEL_1);
LL_DMA_EnableChannel(DMA1,
LL_DMA_CHANNEL_1);
}
This should be one in the next few weeks for the STM32L4 core. Time-triggered ADC, which is what you seem to be after ?
This should be one in the next few weeks for the STM32L4 core. Time-triggered ADC, which is what you seem to be after ?
[GrumpyOldPizza – Fri Sep 08, 2017 12:10 pm] –[gncemre23 – Wed Aug 30, 2017 1:14 pm] –[GrumpyOldPizza – Wed Jun 07, 2017 5:45 pm] –The STM32L4 core as a filesystem called DOSFS (which among other things allows stream writes, an a power safe mode). It does support SDCARD via SPI and SDIO, as well a Serial NOR flashes via QSPI (SPI mode coming; ah, yes, a NOR FTL is used there). With this option you are configuring which of the various devices is attached to DOSFS. As of right now you can only select one. Internally an early initialization is needed so that USB/MSC also can access the same storage device, as well as taking some exclusive pins out of the user accessible definitions in variant.cpp.
So yes, you can use that for data logging via SDIO. We have seen 21MB/sec read and 18 MB/sec write performance throu the filesystem with that. There are a bunch of different options for opening/creating a file in DOSFS that trades off speed vs. power.
I have been trying to use SDIO mode. I’ve changed the variant.cpp and variant.h looking the variant.cpp given for nucleo-dragonfly. However, not succeeded. Can you look at the codes given below, please? Should I do anything more?
#include "FS.h"
#include "stm32l4_wiring_private.h"void setup() {
// put your setup code here, to run once:
stm32l4_sdmmc_initialize(0);
Serial1.begin(9600);}
File dnm;
void loop() {// put your main code here, to run repeatedly:,
if(Serial1.read()=='k')
{
dnm=DOSFS.open("xxx.txt","w+");
if(DOSFS.exists("log.txt"))
Serial1.println("ok");
Serial1.println("opened");
}
if(Serial1.read()=='l')
{
dnm.close();
Serial1.println("closed");
}
}
[gncemre23 – Fri Sep 08, 2017 5:03 pm] –[GrumpyOldPizza – Fri Sep 08, 2017 12:10 pm] –[gncemre23 – Wed Aug 30, 2017 1:14 pm] –
I have been trying to use SDIO mode. I’ve changed the variant.cpp and variant.h looking the variant.cpp given for nucleo-dragonfly. However, not succeeded. Can you look at the codes given below, please? Should I do anything more?
#include "FS.h"
#include "stm32l4_wiring_private.h"void setup() {
// put your setup code here, to run once:
stm32l4_sdmmc_initialize(0);
Serial1.begin(9600);}
File dnm;
void loop() {// put your main code here, to run repeatedly:,
if(Serial1.read()=='k')
{
dnm=DOSFS.open("xxx.txt","w+");
if(DOSFS.exists("log.txt"))
Serial1.println("ok");
Serial1.println("opened");
}
if(Serial1.read()=='l')
{
dnm.close();
Serial1.println("closed");
}
}
[GrumpyOldPizza – Sat Sep 09, 2017 12:46 pm] –[gncemre23 – Fri Sep 08, 2017 5:03 pm] –[GrumpyOldPizza – Fri Sep 08, 2017 12:10 pm] –Sorry for the delay, my daytime job took over my life
You got all the pieces right. Did you also edit boards.txt to include the proper defines ?
That’s ok. Thank you for your reply.. What should i do about board.txt?
Missed that you don’t have a DOSFS.begin() in setup. That should take care of the problem. Editing boards.txt would simply allow you to select a few things directly without having to put them into “setup()”. Latter one should mostly work, but I would not guarantee it. Some code needs to execute before USB starts up, which is before “setup()” is called.
I’m sorry but I don’ understand completely. Where should I edit the to execute the codes before USB starts up?
[gncemre23 – Mon Sep 11, 2017 11:32 am] –[GrumpyOldPizza – Sat Sep 09, 2017 12:46 pm] –[gncemre23 – Fri Sep 08, 2017 5:03 pm] –That’s ok. Thank you for your reply.. What should i do about board.txt?
Missed that you don’t have a DOSFS.begin() in setup. That should take care of the problem. Editing boards.txt would simply allow you to select a few things directly without having to put them into “setup()”. Latter one should mostly work, but I would not guarantee it. Some code needs to execute before USB starts up, which is before “setup()” is called.
I’m sorry but I don’ understand completely. Where should I edit the to execute the codes before USB starts up?
Finally, I have succeeded. I have been trying the SDIO 1-bit mode. When I tried the 4-bit mode, the file is created on the SD card. Thank you for your all responses.