Giter Club home page Giter Club logo

Comments (13)

maxgerhardt avatar maxgerhardt commented on August 25, 2024 1

I see.

I think we then can we conclude the the definitions are okay for Serial and Wire because they're really the only pin choices for USART0 and I2C0? Users can still use Serial, Serial1, Wire, Wire1 as needed to mix-match. Connecting the pins to different devices or headers is a hardware problem and can't be solved in this Arduino core.

from arduinocore-gd32.

maxgerhardt avatar maxgerhardt commented on August 25, 2024 1

F330F8 does exist as a variant here and is referenced in the boards.txt.

ArduinoCore-GD32/boards.txt

Lines 338 to 341 in dfa7ccb

gd_generic_gd32f3x0.menu.pnum.GD32F330F8_GENERIC=GD32F330F8 (Generic)
gd_generic_gd32f3x0.menu.pnum.GD32F330F8_GENERIC.upload.maximum_size=65536
gd_generic_gd32f3x0.menu.pnum.GD32F330F8_GENERIC.upload.maximum_data_size=8192
gd_generic_gd32f3x0.menu.pnum.GD32F330F8_GENERIC.build.board=GD32F330F8_GENERIC

Are you sure you're using https://raw.githubusercontent.com/CommunityGD32Cores/GD32Core-New/main/package_gd32_index.json as the package URL? If you have an older version of tis core previously installed, you need to uninstall + reinstall it in the Arduino IDE boards manager.

from arduinocore-gd32.

maxgerhardt avatar maxgerhardt commented on August 25, 2024

SERIAL0_RX == PIN_WIRE_SDA shouldn't have happened. The problem is that all of these variant.h files are autogenerated by a script, gd32_genpinmap, and this script doesn't have a very sophisticated "pin allocator" to make sure there isn't a double-usage of a pin in two popular peripherals. It just has a "prefered" pin, and if that pin doesn't exist, it goes to the next preferred pin.

As a result of that, definitions like that can happen.

You're free to change the pins to whatever you want -- in limits with the peripheral, of course.

For I2C

/* I2C_SDA PinMap */
const PinMap PinMap_I2C_SDA[] = {
{PORTA_1, I2C1, GD_PIN_FUNCTION4(PIN_MODE_AF, PIN_OTYPE_OD, PIN_PUPD_PULLUP, IND_GPIO_AF_4)}, /* I2C1_SDA */
{PORTA_10, I2C0, GD_PIN_FUNCTION4(PIN_MODE_AF, PIN_OTYPE_OD, PIN_PUPD_PULLUP, IND_GPIO_AF_4)}, /* I2C0_SDA */
{NC, NC, 0}
};
/* I2C_SCL PinMap */
const PinMap PinMap_I2C_SCL[] = {
{PORTA_0, I2C1, GD_PIN_FUNCTION4(PIN_MODE_AF, PIN_OTYPE_OD, PIN_PUPD_PULLUP, IND_GPIO_AF_4)}, /* I2C1_SCL */
{PORTA_9, I2C0, GD_PIN_FUNCTION4(PIN_MODE_AF, PIN_OTYPE_OD, PIN_PUPD_PULLUP, IND_GPIO_AF_4)}, /* I2C0_SCL */
{NC, NC, 0}
};

For UART

/* UART_TX PinMap */
const PinMap PinMap_UART_TX[] = {
{PORTA_2, USART1, GD_PIN_FUNCTION4(PIN_MODE_AF, GPIO_OTYPE_PP, PIN_PUPD_PULLUP, IND_GPIO_AF_1)}, /* USART1_TX */
{PORTA_9, USART0, GD_PIN_FUNCTION4(PIN_MODE_AF, GPIO_OTYPE_PP, PIN_PUPD_PULLUP, IND_GPIO_AF_1)}, /* USART0_TX */
{PORTA_14, USART1, GD_PIN_FUNCTION4(PIN_MODE_AF, GPIO_OTYPE_PP, PIN_PUPD_PULLUP, IND_GPIO_AF_1)}, /* USART1_TX */
{NC, NC, 0}
};
/* UART_RX PinMap */
const PinMap PinMap_UART_RX[] = {
{PORTA_3, USART1, GD_PIN_FUNCTION4(PIN_MODE_AF, GPIO_OTYPE_PP, PIN_PUPD_PULLUP, IND_GPIO_AF_1)}, /* USART1_RX */
{PORTA_10, USART0, GD_PIN_FUNCTION4(PIN_MODE_AF, GPIO_OTYPE_PP, PIN_PUPD_PULLUP, IND_GPIO_AF_1)}, /* USART0_RX */
{NC, NC, 0}
};

from arduinocore-gd32.

maxgerhardt avatar maxgerhardt commented on August 25, 2024

Hah, I actually have to correct myself here. According to that, the only possibility for "Wire", mapping to I2C0, really is PA9, PA10. Same as for USART0!

So, in the application, don't use Serial and Wire at the same time -- but you can use e.g. Serial and Wire1, or Serial1 and Wire, since they're on different pins (mix+match of USART0, USART1, I2C0, I2C1).

Unfortunately I think if you design the hardware with a I2C device on the I2C0 pins (same as USART0 pins), then uploading firmware in the BOOT0 mode will fail, the I2C devices will react to edges of the UART RX and TX signal and screw with the signal, trying to pull it LOW various times.

from arduinocore-gd32.

ITstreet1 avatar ITstreet1 commented on August 25, 2024

From what I have seen, the same goes for most TSSOP20 chips.

I2C needs a pull-up. Yes, I see the problem. Maybe separate the I2C lines with a jumper? This way I can upload a sketch, then solder the I2C jumper and connect the lines...

from arduinocore-gd32.

maxgerhardt avatar maxgerhardt commented on August 25, 2024

I think you can use a double-throw, double-pole switch where, if the switch is UP, then PA9, PA10 lines are connected to the I2C devices, and if DOWN, they are disconnected (or connected to some UART pin headers). That way it's atleast easily switchable.

from arduinocore-gd32.

ITstreet1 avatar ITstreet1 commented on August 25, 2024

Space is the problem. Three-pad solder joint will do the same job. The same one I use as a BOOT selector. Besides, I shouldn't leave an option for a user to mess it up. :)

from arduinocore-gd32.

ITstreet1 avatar ITstreet1 commented on August 25, 2024

Heh,

On GitHub, there is a support for this chip. It clearly says in variants.
But, in Arduino IDE, there is none. Version I have installed is 0.0.1

How to add support for this one chip?

from arduinocore-gd32.

maxgerhardt avatar maxgerhardt commented on August 25, 2024

from arduinocore-gd32.

ITstreet1 avatar ITstreet1 commented on August 25, 2024

1.8.19

from arduinocore-gd32.

ITstreet1 avatar ITstreet1 commented on August 25, 2024

LOL.
This did the trick. I just reinstalled it. I still get the 0.0.1 version, but this time with all the boards in the list.

Thank you.

from arduinocore-gd32.

maxgerhardt avatar maxgerhardt commented on August 25, 2024

We don't version the core yet, so it's been "0.0.1" forever -- a reinstall however will always install the latest version this git repository.

from arduinocore-gd32.

ITstreet1 avatar ITstreet1 commented on August 25, 2024

I believe it should have versions. I didn't get the update option to a newer version, so I didn't know what to do. I thought I have the newest version, and thought it was some kind of a bug.

Thank you anyway, and thank you for your effort.

from arduinocore-gd32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.