Skip to content

New Variant FK407M1 #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from
Closed

New Variant FK407M1 #406

wants to merge 22 commits into from

Conversation

BennehBoy
Copy link
Contributor

Chinese STM32F407VET6 Minimum Development board with USB-C connector and SDIO.

Untested.

Chinese STM32F407VET6 Minimum Development board with USB-C connector and SDIO.
@fpistm fpistm self-requested a review January 14, 2019 07:25
@fpistm fpistm added the new variant Add support of new bard label Jan 14, 2019
@BennehBoy
Copy link
Contributor Author

20-40 days for my boards to ship, oh well 🤣

@fpistm
Copy link
Member

fpistm commented Jan 15, 2019

Do you have a link on this board and the schematics?

@BennehBoy
Copy link
Contributor Author

Boards I've bought -> https://www.aliexpress.com/item/IRS2092-single-channel-amplifier-board-200W/32822107693.html (not sure what the URL is about)

I found schematics tucked away in the HW folder of github repo that I've forked for safe keeping -> https://github.com/BennehBoy/Firmware-ALPHA

@BennehBoy
Copy link
Contributor Author

Blink tested - found issue with PC13 definition (pin is not broken out)

HID bootloader tested

USART, SDIO, SPI to test...

@BennehBoy
Copy link
Contributor Author

USART working (1 & 3)
CDC working
SPI1 working
SDIO working

@BennehBoy
Copy link
Contributor Author

I can't get i2c scanner to report anything, but not just with this board, same problem with 407VE.

The device I'm testing against is found by scanner against rogers core on a maple mini - same wiring.

I'll try and test on bluepill & blackpill shortly.

I'm not forgetting something daft like pin initialisation? Wire lib should take care of that right?

@BennehBoy
Copy link
Contributor Author

Scanning...
Unknown error at address 0x02
Unknown error at address 0x03
Unknown error at address 0x04
Unknown error at address 0x05
Unknown error at address 0x06
Unknown error at address 0x07
Unknown error at address 0x08
Unknown error at address 0x09
Unknown error at address 0x0A
Unknown error at address 0x0B
Unknown error at address 0x0C
Unknown error at address 0x0D
Unknown error at address 0x0E
Unknown error at address 0x0F
Unknown error at address 0x10
Unknown error at address 0x11
Unknown error at address 0x12
Unknown error at address 0x13
Unknown error at address 0x14
Unknown error at address 0x15
Unknown error at address 0x16
Unknown error at address 0x17
Unknown error at address 0x18
Unknown error at address 0x19
Unknown error at address 0x1A
Unknown error at address 0x1B
Unknown error at address 0x1C
Unknown error at address 0x1D
Unknown error at address 0x1E
Unknown error at address 0x1F
Unknown error at address 0x20
Unknown error at address 0x21
Unknown error at address 0x22
Unknown error at address 0x23
Unknown error at address 0x24
Unknown error at address 0x25
Unknown error at address 0x26
Unknown error at address 0x27
Unknown error at address 0x28
Unknown error at address 0x29
Unknown error at address 0x2A
Unknown error at address 0x2B
Unknown error at address 0x2C
Unknown error at address 0x2D
Unknown error at address 0x2E
Unknown error at address 0x2F
Unknown error at address 0x30
Unknown error at address 0x31
Unknown error at address 0x32
Unknown error at address 0x33
Unknown error at address 0x34
Unknown error at address 0x35
Unknown error at address 0x36
Unknown error at address 0x37
Unknown error at address 0x38
Unknown error at address 0x39
Unknown error at address 0x3A
Unknown error at address 0x3B
Unknown error at address 0x3C
Unknown error at address 0x3D
Unknown error at address 0x3E
Unknown error at address 0x3F
Unknown error at address 0x40
Unknown error at address 0x41
Unknown error at address 0x42
Unknown error at address 0x43
Unknown error at address 0x44
Unknown error at address 0x45
Unknown error at address 0x46
Unknown error at address 0x47
Unknown error at address 0x48
Unknown error at address 0x49
Unknown error at address 0x4A
Unknown error at address 0x4B
Unknown error at address 0x4C
Unknown error at address 0x4D
Unknown error at address 0x4E
Unknown error at address 0x4F
Unknown error at address 0x50
Unknown error at address 0x51
Unknown error at address 0x52
Unknown error at address 0x53
Unknown error at address 0x54
Unknown error at address 0x55
Unknown error at address 0x56
Unknown error at address 0x57
Unknown error at address 0x58
Unknown error at address 0x59
Unknown error at address 0x5A
Unknown error at address 0x5B
Unknown error at address 0x5C
Unknown error at address 0x5D
Unknown error at address 0x5E
Unknown error at address 0x5F
Unknown error at address 0x60
Unknown error at address 0x61
Unknown error at address 0x62
Unknown error at address 0x63
Unknown error at address 0x64
Unknown error at address 0x65
Unknown error at address 0x66
Unknown error at address 0x67
Unknown error at address 0x68
Unknown error at address 0x69
Unknown error at address 0x6A
Unknown error at address 0x6B
Unknown error at address 0x6C
Unknown error at address 0x6D
Unknown error at address 0x6E
Unknown error at address 0x6F
Unknown error at address 0x70
Unknown error at address 0x71
Unknown error at address 0x72
Unknown error at address 0x73
Unknown error at address 0x74
Unknown error at address 0x75
Unknown error at address 0x76
Unknown error at address 0x78
Unknown error at address 0x79
Unknown error at address 0x7A
Unknown error at address 0x7B
Unknown error at address 0x7C
Unknown error at address 0x7D
Unknown error at address 0x7E
No I2C devices found

@BennehBoy
Copy link
Contributor Author

Working on Bluepill, so perhaps something common to the GenF4 variants - I cloned the base 407VE to define this?

@BennehBoy
Copy link
Contributor Author

Hmm...

If I force SDA to PB7 and SCL to PB6:

  Wire.setSDA(PB7);
  Wire.setSCL(PB6);

Then it works....

I thought these were the default pins?

From PeripheralPins.c:

#ifdef HAL_I2C_MODULE_ENABLED
const PinMap PinMap_I2C_SDA[] = {
  {PB_7,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
  {PB_9,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
  {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
  {PC_9,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
  {NC,    NP,    0}
};
#endif

#ifdef HAL_I2C_MODULE_ENABLED
const PinMap PinMap_I2C_SCL[] = {
  {PA_8,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
  {PB_6,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
  {PB_8,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
  {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
  {NC,    NP,    0}
};
#endif

@uzi18
Copy link

uzi18 commented Jan 23, 2019

this shows it is better to explicitly set I/Os than think it is set to some defaults

@BennehBoy
Copy link
Contributor Author

Yeah but if this a variant bug that will catch out beginners it's worth fixing...

@uzi18
Copy link

uzi18 commented Jan 23, 2019

Just thinking about move peripheralpins.c from variant to core, so less to fix if something change and could be more generic, also variant will be more. simple

@BennehBoy
Copy link
Contributor Author

I don't really see how that would work, it's specific to each board so if it was in the core it would need so many switches as to make it unintelligible.

@uzi18
Copy link

uzi18 commented Jan 24, 2019

just check stm32generic these variants are realy simple

@BennehBoy
Copy link
Contributor Author

Perhaps, but that's not the way this core is structured - I suspect DianelF had to do a lot of leg work to make the internals work on STM32GENERIC

@fpistm
Copy link
Member

fpistm commented Jan 24, 2019

About variant, lot of work has been done to only have pin mapping to define.
Anyway, I would like to remove one of the definition (pin number or digitalPins[]) this would be easiest to only define pin ordering.
But this is not so easy to do as it intends to be Arduino compatible (D0/A0... and all stuff linked to that (PXn must be a define, analog have to be consecutive to be able to iterate,... )). This is the main drawback.
If it only manage pin name this will simplify.

@BennehBoy
Copy link
Contributor Author

On that note, analog pins are not consecutive in this variant - they are broken out at seemingly random so PeripheralPins.c would be a bit confusing for anyone looking at it (I think).

@zoomx
Copy link
Contributor

zoomx commented Jan 24, 2019

@fpistm,
the Arduino compatibility is used only on boards that has these pin name written on PCB. All other boards don't have these names so I believe it's better to use PXn. IT is the same solution used in ESP8266 and TI (Texas Instruments) core.

@BennehBoy
Copy link
Contributor Author

@fpistm,
the Arduino compatibility is used only on boards that has these pin name written on PCB. All other boards don't have these names so I believe it's better to use PXn. IT is the same solution used in ESP8266 and TI (Texas Instruments) core.

I agree, but it IS nice to have the integer value of say A0 be the same as it's PXn equivalent - perhaps the readme.md should simply state which boards do and do not have Arduino pin equivalency?

fpistm and others added 4 commits January 25, 2019 09:37
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Chinese STM32F407VET6 Minimum Development board with USB-C connector and SDIO.
BennehBoy and others added 15 commits January 25, 2019 13:02
I thought I had set the I2C pins to the arduino compatible
values, but it seems I messed that up. This change will
set the defaults for the board variant RemRam V1.
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
Chinese STM32F407VET6 Minimum Development board with USB-C connector and SDIO.
Chinese STM32F407VET6 Minimum Development board with USB-C connector and SDIO.
Chinese STM32F407VET6 Minimum Development board with USB-C connector and SDIO.
@BennehBoy
Copy link
Contributor Author

I'm going to leave the I2C pins as is.

Analogue read is tested and working.

Any other tests required?

@fpistm fpistm closed this in 912647f Jan 29, 2019
@fpistm
Copy link
Member

fpistm commented Jan 29, 2019

Thanks @BennehBoy
I've rebased it manually and did some clean that's why I did not merge this one.

@BennehBoy BennehBoy deleted the FK407M1 branch January 29, 2019 15:29
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Chinese STM32F407VET6 Minimum Development board with USB-C connector
and SDIO.

Based and close stm32duino#406

Signed-off-by: BennehBoy <bennyboy@benneh.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new variant Add support of new bard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants