different IP than expected

2023-09-20 Thread Gustavo Soares
Hello everyone!

 I configured NuttX to a certain IP address and I have a webserver which 
listens to the defined IP:

[cid:820c9f69-369e-403b-8928-15a97245100a]

[cid:a42eded4-3e24-4b28-b0a7-07170d21a404]

The HTML file above has a variable that contains the server IP address, but it 
is a different one:

[cid:5e9d6cae-0b80-47cd-a05d-f9d52e1fdf80]

the server replaces the text SERVER_IP_ADDRESS to it's actual IP and then sends 
the file to the client. This is the method I used to get the IP address:

[cid:f59e2b66-2f08-4aa7-895c-936b962eab26]

Why is it a different IP? The server is listening to one but this method 
returns another one.



Re: fat32 sd-card filesystem broken

2023-09-20 Thread Nathan Hartman
On Wed, Sep 20, 2023 at 1:58 PM Petro Karashchenko <
petro.karashche...@gmail.com> wrote:

> Hi,
>
> I think that FAT32 is not a fail-safe file system by its nature. There may
> be data losses (file table corruption) in case of power loss during file
> write (file table update) or maybe in some other cases when file system
> access is interrupted.



Regarding hardware (because others haven't mentioned it yet): Are you able
to verify signal integrity to the SD card hardware? I don't remember off
the top of my head but are there pull-up resistors and/or capacitors
required on the SD card lines and, if so, are they populated and soldered
correctly? Any other solder connections that might need reflowing?

Nathan


Re: STM Nucleo-32 board - I2C functionality

2023-09-20 Thread Alan C. Assis
Hi Stewart,

On 9/20/23, Stewart Charnell  wrote:
> Hi,
>
> Has anyone used the I2C functionality on the STM Nucleo-32 board (it
> uses the STM32L432 processor)? I think there is an issue with the file
> boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c.
>
> This board can support Arduino NANO pinout compatibility by using links
> on the PCB.
> Section '6.10 Solder bridges' of doc. 'UM1956 User manual STM32
> Nucleo-32 boards (MB1180)' details these links.
>
> One option for the I2C1 interface is to use STM32L432 pins PB_7
> (function I2C1_SDA, PCB pin D4) & PA_6 (function I2C1_SCL, PCB pin D5),
> which are linked by solder bridges on the PCB to STM32L432 pins PA_6
> (PCB pin A5) & PA_5 (PCB pin A4) to maintain Arduino NANO pinout
> compatibility.
>
> The webpage os.mbed.com/platforms/ST-Nucleo-L432KC has a picture of the
> PCB showing the pinout options, and this Information:
>
> By default the PA_5 (A4) and PA_6 (A5) pins can only be used as Input
> floating (ADC function).
> Remove SB16 and SB18 solder bridges in order to use these pins as
> Digital output and have access
> to other functions (DigitalOut, SPI, PWM, etc...).
>
> The file boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c contains
> these lines:
>
> /* Configure D4(PA5) and D5(PA6) as input floating */
>
> stm32l4_configgpio(GPIO_I2C1_D4);
> stm32l4_configgpio(GPIO_I2C1_D5);
>
> Where GPIO_I2C1_D4 & GPIO_I2C1_D5 are defined in
> boards/arm/stm32l4/nucleo-l432kc/include/board.h
>

Yes, the comments is incorrect since it is defined to pins PB7 and PB6:

#define GPIO_I2C1_D4 \
   (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN7)
#define GPIO_I2C1_D5 \
   (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN6)

> However the device pins PA5 and PA6 correspond to PCB pins A4 and A5
> respectively, not PCB pins D4 and D5.
> These calls to the stm32l4_configgpio functions cause the I2C1 lines to
> be disabled.
>

Daniel, since you submitted support to it and could know more about
it, could you please help to clarify these things?

BR,

Alan


Re: fat32 sd-card filesystem broken

2023-09-20 Thread Petro Karashchenko
Hi,

I think that FAT32 is not a fail-safe file system by its nature. There may
be data losses (file table corruption) in case of power loss during file
write (file table update) or maybe in some other cases when file system
access is interrupted.
I think HCC had some product called SafeFAT that was basically building a
kind of fail safe operation by creating shadow files and implementing a
kind of "commit" swap between shadow and real file, so the file table is
not destroyed if operation is interrupted. I used that a long time ago and
do not recall all the implementation details, but know the basic idea
behind that.

I'm not sure what is the best option for FS on top of SD card to get fail
safe operation and especially is any of those options available in nuttx.

Best regards,
Petro

ср, 20 вер. 2023 р. о 19:36 Alan C. Assis  пише:

> Hi Simon,
>
> I tested it recently (not extensive test) and it was working fine
> (stm32f777 meadow board).
>
> Did you try to run apps/testing/fstest to push its hard(ware) limits? :-)
>
> Also a simple way to verify if FAT is working is creating a RAMDISK
> (formatted as FAT) and run your application using it.
>
> If some issue was introduced if the kernel itself (instead of in your
> MCU) it could be detected using RAMDISK even in the SIMulator (you can
> copy the /dev/ramX content to a file and then check it on your host
> computer using the dos check tool).
>
> BR,
>
> Alan
>
> On 9/20/23, Simon Filgis  wrote:
> > Dear all,
> >
> > Once in a while nuttx breaks the fat32 filesystem of my sd-card.
> >
> > Custom fork, around 1 year old. samv7, DMA enabled.
> >
> > I have syslog to sd-card enabled. Also a FTP server accepts files to
> > sd-card.
> >
> > Has anybody observed something similar? How to start debugging such an
> > issue?
> >
> > Simon
> >
> > --
> > Hard- and Softwaredevelopment Consultant
> > Ingenieurbüro-Filgis
> > USt-IdNr.: DE305343278
> >
>


STM Nucleo-32 board - I2C functionality

2023-09-20 Thread Stewart Charnell

Hi,

Has anyone used the I2C functionality on the STM Nucleo-32 board (it 
uses the STM32L432 processor)? I think there is an issue with the file 
boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c.


This board can support Arduino NANO pinout compatibility by using links 
on the PCB.
Section '6.10 Solder bridges' of doc. 'UM1956 User manual STM32 
Nucleo-32 boards (MB1180)' details these links.


One option for the I2C1 interface is to use STM32L432 pins PB_7 
(function I2C1_SDA, PCB pin D4) & PA_6 (function I2C1_SCL, PCB pin D5),
which are linked by solder bridges on the PCB to STM32L432 pins PA_6 
(PCB pin A5) & PA_5 (PCB pin A4) to maintain Arduino NANO pinout 
compatibility.


The webpage os.mbed.com/platforms/ST-Nucleo-L432KC has a picture of the 
PCB showing the pinout options, and this Information:


By default the PA_5 (A4) and PA_6 (A5) pins can only be used as Input 
floating (ADC function).
Remove SB16 and SB18 solder bridges in order to use these pins as 
Digital output and have access

to other functions (DigitalOut, SPI, PWM, etc...).

The file boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c contains 
these lines:


   /* Configure D4(PA5) and D5(PA6) as input floating */

   stm32l4_configgpio(GPIO_I2C1_D4);
   stm32l4_configgpio(GPIO_I2C1_D5);

Where GPIO_I2C1_D4 & GPIO_I2C1_D5 are defined in 
boards/arm/stm32l4/nucleo-l432kc/include/board.h


However the device pins PA5 and PA6 correspond to PCB pins A4 and A5 
respectively, not PCB pins D4 and D5.
These calls to the stm32l4_configgpio functions cause the I2C1 lines to 
be disabled.


Kind regards

Stewart Charnell




Re: fat32 sd-card filesystem broken

2023-09-20 Thread Alan C. Assis
Hi Simon,

I tested it recently (not extensive test) and it was working fine
(stm32f777 meadow board).

Did you try to run apps/testing/fstest to push its hard(ware) limits? :-)

Also a simple way to verify if FAT is working is creating a RAMDISK
(formatted as FAT) and run your application using it.

If some issue was introduced if the kernel itself (instead of in your
MCU) it could be detected using RAMDISK even in the SIMulator (you can
copy the /dev/ramX content to a file and then check it on your host
computer using the dos check tool).

BR,

Alan

On 9/20/23, Simon Filgis  wrote:
> Dear all,
>
> Once in a while nuttx breaks the fat32 filesystem of my sd-card.
>
> Custom fork, around 1 year old. samv7, DMA enabled.
>
> I have syslog to sd-card enabled. Also a FTP server accepts files to
> sd-card.
>
> Has anybody observed something similar? How to start debugging such an
> issue?
>
> Simon
>
> --
> Hard- and Softwaredevelopment Consultant
> Ingenieurbüro-Filgis
> USt-IdNr.: DE305343278
>


fat32 sd-card filesystem broken

2023-09-20 Thread Simon Filgis
Dear all,

Once in a while nuttx breaks the fat32 filesystem of my sd-card.

Custom fork, around 1 year old. samv7, DMA enabled.

I have syslog to sd-card enabled. Also a FTP server accepts files to
sd-card.

Has anybody observed something similar? How to start debugging such an
issue?

Simon

--
Hard- and Softwaredevelopment Consultant
Ingenieurbüro-Filgis
USt-IdNr.: DE305343278


RE: iMXRT usbdev endpoint allocation problem

2023-09-20 Thread David Sidrane
Hi Marten ,

See https://github.com/apache/nuttx/pull/4784

Furthermore once all the caching was working, the USB driver had a bug
that the bulk endpoints was getting confused with the interrupt endpoints
and although sized to 512 where reporting a max size of 1024 causing more
fun memory overwrites.

So it was because of memory overwrites.

How would you suggest it be changed?

David

-Original Message-
From: Mårten Svanfeldt 
Sent: Friday, September 15, 2023 4:23 AM
To: dev@nuttx.apache.org
Subject: iMXRT usbdev endpoint allocation problem

Hi,


I'm in the process of updating our internal NuttX from version 10.1 to
12.2.1, and ran into some issues with usb device code on iMXRT.


We have a device that exposes a custom class with a fixed endpoint mapping
(the toolstack in the other end expects certain endpoint mappings, using
ep1 and ep2 for bulk transfers), and I can make it work again by reverting
the following commit
https://github.com/apache/nuttx/commit/c077361a8a9fc9182b988dee7224043022e
ea841


>From a theoretical standpoint I don't understand why that commit was ever
made. The USB controller in iMXRT10xx series, which is same as in other
iMX chips (iMX6 for example) has no limitations of that certain endpoints
needs to map to interrupt/bulk/iso, so I would suggest that the change
itself is actually wrong and should be reverted upstream. Does anyone have
any more background on the change, the git commit message is very terse...


Regards

Marten Svanfeldt