CANFD on ST32H7
Hi, I'm currently in the process of testing all peripherials on my Nucleo STM32H743ZI board. So far, I2C, SPI, UART, and Ethernet seem to work. My next step would be CANFD, but I've noticed that there is no stm32_can.c/.h in arch/arm/src/stm32h7 as there is for stm32f7. Since the F7 doen't have CANFD I assume I cannot use the f7 can driver on the h7 even if I would loose CAN-FD capability. Are there plans to support CAN on STM32H7? Is there any schedule for this? Thanks Frank-Christian
Re: CANFD on ST32H7
Hi Frank-Christian, I don't know whether it's on anyone's to-do list, (I just joined this mailing list a few weeks ago myself), but I "CAN" say that if you are interested in writing your own driver it shouldn't be terribly difficult (I'm working on a driver for the TI Tiva chips currently). As you already found, the stm32_can driver is a good example for the classic (char device) CAN model. For the new SocketCAN model (see net/can) there's a driver contributed (I think) by NXP for one of their chips (see arch/arm/src/s32k1xx/s32k1xx_flexcan.c) I decided to implement a classic character device CAN driver for Tiva myself since I wasn't sure whether the SocketCAN model was stable when I started, but I don't think a SocketCAN driver model would be too much more difficult. There's a brief overview in the documentation [1]. Matt [1] https://nuttx.apache.org/docs/latest/components/drivers/special/socketcan.html On Thu, Dec 17, 2020 at 11:06 AM Frank-Christian Kruegel wrote: > > Hi, > > I'm currently in the process of testing all peripherials on my Nucleo > STM32H743ZI board. So far, I2C, SPI, UART, and Ethernet seem to work. > > My next step would be CANFD, but I've noticed that there is no > stm32_can.c/.h in arch/arm/src/stm32h7 as there is for stm32f7. > > Since the F7 doen't have CANFD I assume I cannot use the f7 can driver > on the h7 even if I would loose CAN-FD capability. > > Are there plans to support CAN on STM32H7? Is there any schedule for this? > > Thanks > > Frank-Christian
Re: ADXL372 sensor test fail
Dear Nuttx, I'm trying according to your instructions. But still cannot read sensor. I don't understand why ID is 0x. [cid:07735f7d-1a47-42b7-b827-0e7af231fa04] Is it related with SPI CS pin. I tried with MEMS Chip select pin to 1. ground 2. PC1 [cid:9cafed8e-3666-4626-8067-702173b5350c]3. PF6(NSS pin) But still I cannot get data from sensor. Can you suggest me please. And according to your instuction, $ make menuconfig Build Setup ---> Debug Options ---> [*] Enable Debug Features [*] Enable Error Output [*] Enable Warnings Output [*] Enable Informational Debug Output [*] Sensor Debug Features [*] Sensor Error Output [*] Sensor Warnings Output [*] Sensor Informational Output I enable these in menu config, how can i check sensor error ouput, warning output, etc. Please advise me. Best Regards, Marlar From: Alan Carvalho de Assis Sent: Friday, December 11, 2020 7:07 PM To: dev@nuttx.apache.org Cc: Shee Cheng Yap Subject: Re: ADXL372 sensor test fail You need to enable the Sensors debug to see these sensor's messages: $ make menuconfig Build Setup ---> Debug Options ---> [*] Enable Debug Features [*] Enable Error Output [*] Enable Warnings Output [*] Enable Informational Debug Output [*] Sensor Debug Features [*] Sensor Error Output [*] Sensor Warnings Output [*] Sensor Informational Output BR, Alan On 12/11/20, Xiang Xiao wrote: > nuttx/include/errno.h define ENODEV to 19: > #define ENODEV 19 > and nuttx/drivers/sensors/adxl372.c return ENODEV if id mismatch: > static int adxl372_dvr_open(FAR void *instance_handle, int32_t arg) > { > /* Read the ID registers */ > > pnpid = adxl372_read_id(priv); > priv->readonly = false; > > sninfo("ADXL372_ID = 0x%08x\n", pnpid); > > if ((pnpid & 0xff00) != (ADXL372_DEVID_AD_VALUE << 24 | >ADXL372_DEVID_MST_VALUE << 16 | >ADXL372_PARTID_VALUE << 8)) > { > snwarn("ERROR: Invalid ADXL372_ID = 0x%08x\n", pnpid); > > priv->readonly = true; > set_errno(ENODEV); > } > You have to check what's the value in pnpid. > > On Fri, Dec 11, 2020 at 2:28 PM Marlar Chan wrote: > >> Dear Nuttx, >>I'm testing with stm32f429-disco with adxl372 sensor. I tried to run >> sample demo adxl372_test. Device id is seen on /dev. But sensor cannot >> start run and i face with the following issue. Please suggest me any idea >> what is wrong with it. >> >> Best Regards, >> Marlar >> -- >> >> CONFIDENTIALITY: This email is intended solely for the person(s) named >> and >> may be confidential and/or privileged. If you are not the intended >> recipient, please delete it, notify us and do not copy, use, or disclose >> its contents. >> Towards a sustainable earth: Print only when necessary. Thank you. >> >
Re: ADXL372 sensor test fail
To debug this type of problem you need to be able to observe the activity on the SPI bus. A 4-channel scope would be ideal, but you can do it with a 2-channel scope. Most likely, you are not routing your "SPI chip select" to the appropriate GPIO pin. That could be caused by several factors. Can you communicate to other devices on the SPI bus? If so, then the the problem is most definitely the "chip select". If not, then you need to observe the bus and determine what is going wrong. Are you seeing a clean SPI SCLK signal at the sensor pad? Is the expected data is being transferred outbound on the SPI bus? Is the sensor chip responding as expected? Are the signals on all bus wires clean and sharp? Long wires on an 6MHz+ bus create lots of damaging reflections. Long traces/wires on this type of bus can mean anything over 4 inches. (Actually, the precise definition is that if the electrical signal needs travel to the end of the bus, reflect back; and all reflections reach the output transistor while it is still switching (in the transistor's active region), then the output transistor will absorb the reflection and the signal should be clean. If the reflection arrives later than it will be reflected back over the trace/wire as an extraneous pulse. If that's the case, the bus layout or the bus timing needs to be fixed. If all the electrical signals look clean (no noise), but not correct (wrong values), then if the incorrectness is an outbound signal from the MCU and there is a driver problem. If its an inbound signal from the sensor that's wrong, its either a driver problem (the driver told the sensor the wrong thing to do) or the sensor is broken (it was given the correct command, but did not comply). This can often become a complex hardware/software problem. (That's what makes these problems fun to solve.) -Bob On 12/17/2020 7:09 PM, Marlar Chan wrote: Dear Nuttx, I'm trying according to your instructions. But still cannot read sensor. I don't understand why ID is 0x. Is it related with SPI CS pin. I tried with MEMS Chip select pin to 1. ground 2. PC1 3. PF6(NSS pin) But still I cannot get data from sensor. Can you suggest me please. And according to your instuction, $ make menuconfig Build Setup ---> Debug Options ---> [*] Enable Debug Features [*] Enable Error Output [*] Enable Warnings Output [*] Enable Informational Debug Output [*] Sensor Debug Features [*] Sensor Error Output [*] Sensor Warnings Output [*] Sensor Informational Output I enable these in menu config, how can i check sensor error ouput, warning output, etc. Please advise me. Best Regards, Marlar *From:* Alan Carvalho de Assis *Sent:* Friday, December 11, 2020 7:07 PM *To:* dev@nuttx.apache.org *Cc:* Shee Cheng Yap *Subject:* Re: ADXL372 sensor test fail You need to enable the Sensors debug to see these sensor's messages: $ make menuconfig Build Setup ---> Debug Options ---> [*] Enable Debug Features [*] Enable Error Output [*] Enable Warnings Output [*] Enable Informational Debug Output [*] Sensor Debug Features [*] Sensor Error Output [*] Sensor Warnings Output [*] Sensor Informational Output BR, Alan On 12/11/20, Xiang Xiao wrote: > nuttx/include/errno.h define ENODEV to 19: > #define ENODEV 19 > and nuttx/drivers/sensors/adxl372.c return ENODEV if id mismatch: > static int adxl372_dvr_open(FAR void *instance_handle, int32_t arg) > { > /* Read the ID registers */ > > pnpid = adxl372_read_id(priv); > priv->readonly = false; > > sninfo("ADXL372_ID = 0x%08x\n", pnpid); > > if ((pnpid & 0xff00) != (ADXL372_DEVID_AD_VALUE << 24 | > ADXL372_DEVID_MST_VALUE << 16 | > ADXL372_PARTID_VALUE << 8)) > { > snwarn("ERROR: Invalid ADXL372_ID = 0x%08x\n", pnpid); > > priv->readonly = true; > set_errno(ENODEV); > } > You have to check what's the value in pnpid. > > On Fri, Dec 11, 2020 at 2:28 PM Marlar Chan wrote: > >> Dear Nuttx, >> I'm testing with stm32f429-disco with adxl372 sensor. I tried to run >> sample demo adxl372_test. Device id is seen on /dev. But sensor cannot >> start run and i face with the following issue. Please suggest me any idea >> what is wrong with it. >> >> Best Regards, >> Marlar >> -- >> >> CONFIDENTIALITY: This email is intended solely for the person(s) named >> and >> may be confidential and/or privileged. If you are not the intended >> recipient, please delete it, notify us and do not copy, use, or disclose >> its contents. >> Towards a sustainable earth: Print only when necessary. Thank you. >> >