[STM32GENERIC] F429i Discovery

Discussions about the STM32generic core
danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [STM32GENERIC] F429i Discovery

Post by danieleff » Wed Jul 12, 2017 3:01 pm

With some PinMap magic glue code, ethernet compiles, just

Code: Select all

WARNING: library LwIP claims to run on [stm32] architecture(s) and may be incompatible with your current board which runs on [STM32] architecture(s).
WARNING: library STM32Ethernet claims to run on [stm32] architecture(s) and may be incompatible with your current board which runs on [STM32] architecture(s).
I will rename the main folder from STM32 to stm32.

Other than that, I think libraries can work on both cores.

zmemw16
Posts: 1491
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: [STM32GENERIC] F429i Discovery

Post by zmemw16 » Wed Jul 12, 2017 4:15 pm

aren't those from the library.properties file ?
add ',stm32' to the architectures line
stephen

fpiSTM
Posts: 251
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: [STM32GENERIC] F429i Discovery

Post by fpiSTM » Wed Jul 12, 2017 5:04 pm

it's case sensitive ;) maybe we could add ',STM32' in the library.properties
Fine if it's both compatible. That's why I would like one repo for each lib and not integrate it in the core ;)

ChrisMicro
Posts: 308
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: [STM32GENERIC] F429i Discovery

Post by ChrisMicro » Sat Sep 16, 2017 6:39 am

Because daniel has meanwhile done some work for the F429 disco, I added a TFT voltmeter example.

It reads the voltage from PA0 and displays it. PA0 is connected to the blue button of the board. I you press the button the displayed voltage changes to 3.3V.
I have tried other pins e.g. PA1 but there seems to be a driver problem. PA1 shows always '0'.

ChrisMicro
Posts: 308
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: [STM32GENERIC] F429i Discovery

Post by ChrisMicro » Mon Sep 18, 2017 8:35 pm

I tried to find the touch controller which should be connected to I2C3 with the scanner.
But it does not respond. So either there is a fault in my scanner configuration or there is a problem with the I2C3 implementation.
Because I tried to measure the I2C3 signals wiht the oscilloscope on PA8 and PC9 and there where no signaIs, I think there is a problem with the I2C implementaion

Anny idea?:

Code: Select all

#include <Wire.h>

#define SERIALINTERFACE Serial

void setup()
{
  //Wire.begin();
  Wire.stm32SetInstance(I2C3);
  Wire.stm32SetSDA(PC9);
  Wire.stm32SetSCL(PA8);
  
  //enableDevices();

  SERIALINTERFACE.begin(115200);
  delay(5000);
  SERIALINTERFACE.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  SERIALINTERFACE.println("Scanning...");
  delay(2000);

  nDevices = 0;
  for (address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    Wire.write(0);
    error = Wire.endTransmission();

    if (error == 0)
    {
      SERIALINTERFACE.print("I2C device found at address 0x");
      if (address < 16)  SERIALINTERFACE.print("0");
      SERIALINTERFACE.print(address, HEX);
      SERIALINTERFACE.println("  !");

      nDevices++;

    }
    else if (error == 4)
    {
      SERIALINTERFACE.print("no device found at address 0x");
      if (address < 16) SERIALINTERFACE.print("0");
      SERIALINTERFACE.println(address, HEX);
    }
  }
  if (nDevices == 0)
  {
    SERIALINTERFACE.println("No I2C devices found\n");
    SERIALINTERFACE.println("Did you configure the chip select for your device?\n");
  }
  else
    SERIALINTERFACE.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}


TFTLCDCyg
Posts: 7
Joined: Tue Sep 20, 2016 5:06 pm

Re: [STM32GENERIC] F429i Discovery

Post by TFTLCDCyg » Mon Sep 18, 2017 9:33 pm

In the same line that the ChrisMicro question, about the F429I-DISCO board:

Is it possible to remap the full GPIO with STM32CubeMX in order to activated I2C2, I2C3, SDIO, SPI4, SPI5 or SPI6 for example?

danieleff
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: [STM32GENERIC] F429i Discovery

Post by danieleff » Tue Sep 19, 2017 5:11 am

1. Is it an already existing library that is not written by you, that is dumb and only knows about the first instance of Wire?

Code: Select all

void setup() {
    Wire.stm32SetInstance(I2C3);
    Wire.stm32SetSDA(PC9);
    Wire.stm32SetSCL(PA8);
    
    DumbLibrary.begin(); // dumb library does not know that the chip has multiple I2C, and thinks there is only Wire. What a shame... READ THE LIBRARY DOCUMENTATION
    // THE PREVIOUS LINE WILL CALL Wire.begin() !!!
}
2. Is it an already existing library not written by you, that knows that there are multiple I2C ports on the chip?

Code: Select all

TwoWire MyWire(I2C3, PC9, PA8);

void setup() {
    SmartLibrary.begin(&MyWire); // Smart library knows that there are chips with multiple I2C ports. Nice! READ THE LIBRARY DOCUMENTATION
    // the previous line will call MyWire.begin() probably...
}
3. You yourself are calling the Wire.xxx methods yourself?

Code: Select all

TwoWire MyWire(I2C3, PC9, PA8);

void setup() {
    MyWire.begin();
    // Do whatever with MyWire
}
Ditto for SPI.
Chris you forgot to call Wire.begin() after changing the pins, but it would be better to use the 3rd option for non-first I2C, whenever you can get away with it.

ChrisMicro
Posts: 308
Joined: Fri Mar 24, 2017 4:51 pm
Location: Germany

Re: [STM32GENERIC] F429i Discovery

Post by ChrisMicro » Tue Sep 19, 2017 12:30 pm

Chris you forgot to call Wire.begin()
Damn it .. I looked 10 times and didn't see :(

But thanks :D
Here I made the new TFT touch screen example

Post Reply