Skip to content

"This header is not available in freestanding mode." #2

Description

@NoNamedCat

描述一下这个bug / Describe the bug

when I try to compile the simple "blink" program the output says:

.arduino15/packages/PY32Duino/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/arm-none-eabi/include/c++/13.2.1/bits/requires_hosted.h:34:4: error: #error "This header is not available in freestanding mode."
34 | # error "This header is not available in freestanding mode."

复现步骤 / To Reproduce

v0.1.1
System: Linux Mint

如果正常,应该是什么样 / Expected behavior

Compile the sketch.

截图 / Screenshots

image

日志 / Logs

.arduino15/packages/PY32Duino/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/arm-none-eabi/include/c++/13.2.1/bits/requires_hosted.h:34:4: error: #error "This header is not available in freestanding mode."
34 | # error "This header is not available in freestanding mode."

系统 / System

Mint 22.04

PACK包版本 / Version

0.1.1

验证

  • 检查过该问题,之前没有人提过 / Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 提供了最小可复现工程或详细的复现步骤,确保开发者可以复现 / The provided reproduction is a minimal reproducible example of the bug.
  • 已经提供了完整的报错信息、日志、截图,没有经过删减。

Activity

  1. HalfSweet commented on Dec 1, 2023

    @HalfSweet
    Member

    Fixed in 0.1.2

  2. NoNamedCat commented on Dec 1, 2023

    @NoNamedCat
    Author

    Tks HalfSweet

  3. NoNamedCat commented on Dec 1, 2023

    @NoNamedCat
    Author

    Sorry. With the 0.1.2 i have this issue:

    WARNING: library SrcWrapper claims to run on AirMCU architecture(s) and may be incompatible with your current board which runs on PY32 architecture(s).
    In file included from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/PY32F0xx/py32f0xx_hal_conf_default.h:220,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/PY32F0xx/py32f0xx_hal_conf.h:13,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal.h:33,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:195,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/py32/py32_def.h:26,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/py32/clock.h:19,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/wiring_time.h:23,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/wiring.h:38,
    from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/Arduino.h:36,
    from /tmp/arduino/sketches/2C45634B9C38D38B552DD500A30E66FE/sketch/sketch_dec1a.ino.cpp:1:
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_dma.h:116:3: error: 'DMA_Channel_TypeDef' does not name a type; did you mean 'DMA_InitTypeDef'?
    116 | DMA_Channel_TypeDef Instance; /!< Register base address */
    | ^~~~~~~~~~~~~~~~~~~
    | DMA_InitTypeDef
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_dma.h:136:3: error: 'DMA_TypeDef' does not name a type; did you mean 'TIM_TypeDef'?
    136 | DMA_TypeDef DmaBaseAddress; /!< DMA Channel Base Address */
    | ^~~~~~~~~~~
    | TIM_TypeDef
    In file included from /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/PY32F0xx/py32f0xx_hal_conf_default.h:284:
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rtc.h:173:3: error: 'RTC_TypeDef' does not name a type; did you mean 'RCC_TypeDef'?
    173 | RTC_TypeDef Instance; /!< Register base address */
    | ^~~~~~~~~~~
    | RCC_TypeDef
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/py32/backup.h: In function 'void resetBackupDomain()':
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1251:60: error: 'RCC_BDCR_BDRST' was not declared in this scope
    1251 | #define __HAL_RCC_BACKUPRESET_FORCE() SET_BIT(RCC->BDCR, RCC_BDCR_BDRST)
    | ^~~~~~~~~~~~~~
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:170:42: note: in definition of macro 'SET_BIT'
    170 | #define SET_BIT(REG, BIT) ((REG) |= (BIT))
    | ^~~
    /home/nigrum/.arduino15/packages/PY32Duino/hardware/PY32/0.1.2/cores/arduino/py32/backup.h:71:3: note: in expansion of macro '__HAL_RCC_BACKUPRESET_FORCE'
    71 | __HAL_RCC_BACKUPRESET_FORCE();
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

    exit status 1

    Compilation error: exit status 1

  4. HalfSweet commented on Dec 1, 2023

    @HalfSweet
    Member

    What development board model did you choose?

  5. NoNamedCat commented on Dec 1, 2023

    @NoNamedCat
    Author

    PY32F002

  6. NoNamedCat commented on Dec 1, 2023

    @NoNamedCat
    Author

    When I choose the PY32F030 i have another problem:

    WARNING: library SrcWrapper claims to run on AirMCU architecture(s) and may be incompatible with your current board which runs on PY32 architecture(s).
    /home/nigrum/.arduino15/packages/PY32Duino/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino/sketches/2C45634B9C38D38B552DD500A30E66FE/sketch_dec1a.ino.elf section ._user_heap_stack' will not fit in region RAM'
    /home/nigrum/.arduino15/packages/PY32Duino/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 304 bytes
    collect2: error: ld returned 1 exit status

    exit status 1

    Compilation error: exit status 1

    This is with the blink example.

  7. HalfSweet commented on Dec 2, 2023

    @HalfSweet
    Member

    When choosing the F003 or F030 models with 2k RAM, it is possible that the linker will complain about not having enough RAM space. This problem is due to the fact that the framework takes up too much of it... and the main Serial library takes up quite a bit.

    We can switch to the Disabled (no Serial support) option in the U(S)ART support settings, or modify the buffer size by manual injection, which will help solve the problem.

  8. HalfSweet commented on Dec 2, 2023

    @HalfSweet
    Member

    In version 0.1.3, PY32F002A should compile properly.

    Feel free to contact me if you have any problems with the runtime, and any comments you can make about this project would be greatly appreciated.

  9. garudaonekh commented on Dec 2, 2023

    @garudaonekh

    Yes, it works with PY32F002 now.

  10. NoNamedCat commented on Dec 4, 2023

    @NoNamedCat
    Author

    I don't want to open a new issue for this question HalfSweet. Forgive me if posting this question here is wrong. I will delete it if so.
    Do you have info about the py32f002 and its ram?
    The datasheet says something about it, but in reality it has 4kb of ram. I have many boards (I purchased the chips on LCSC) and all of the chips report 4kb of ram instead of the 3kB of static RAM that the datasheet says.
    All the people on forums have the same behavior on the chips (Seems that the silicon inside is the same as the PY32F030x6(32KB Flash/4KB RAM), in fact in many forums they said that is possible to use the py32f002 as a py32f030x6 without a problem. Is really confusing to me all of this. If I want to design a product with this IC obviulsy is recommended to follow the datasheet and the specs. But why they use a more complete silicon and sell the chips with a lower price?
    Also... the py32f series is a clone of the AirMCU family?

  11. HalfSweet commented on Dec 4, 2023

    @HalfSweet
    Member

    It's a hard one to average out, maybe the chip makers will use the same core inside multiple chips with different labeling for their own profit maximization or to reduce inventory, which might lead us to misunderstandings about the overall product.

    But in any case, this repository will follow the datasheet and you can choose another model if you need to, in theory this will not be a problem.

    Both AirMCU and PY32Duino are maintained by me, including OpenPuya in the future, but these are two different companies and eventually there may be some features that will not be fully synchronized.

    Finally, thanks for your love of this project, and if you run into any problems, feel free to ask!

  12. NoNamedCat commented on Dec 4, 2023

    @NoNamedCat
    Author

    I found another company making the same chip? The datasheet is very similar with the specs of the IC. I have to translate and read it. But for me sound like it is the same.
    https://www.lcsc.com/product-detail/Microcontroller-Units-MCUs-MPUs-SOCs_Geehy-APM32F003F6P6_C2975251.html

  13. NoNamedCat commented on Dec 4, 2023

    @NoNamedCat
    Author

    Here is the schematic for a board that I'm designing. What do you think? Are you interested on the design?
    PY-CAT-002

  14. HalfSweet commented on Dec 4, 2023

    @HalfSweet
    Member

    Sorry, I'm not familiar with Geehy as a company.

    But it's not surprising for a Cortex-M core processor to have similar or even the same peripheral IP, so if it really doesn't differ much from the py32, maybe I can add it to this project.

  15. NoNamedCat commented on Dec 4, 2023

    @NoNamedCat
    Author

    I grabbed the bootloader part from your design.
    Here is the render of the board:
    bottom
    top

  16. HalfSweet commented on Dec 4, 2023

    @HalfSweet
    Member

    Here is the schematic for a board that I'm designing. What do you think? Are you interested on the design? PY-CAT-002

    One thing worth noting is that the PY32 doesn't necessarily interact well with 3.3V level peripherals - either UARTs or SWDs - when it's running on a 5V supply, which I think is kind of a pitfall.

    And, the V3 pin of the CH340 seems to require an external 0.1uF capacitor, I'm not quite sure, you'll need to check the datasheet

  17. locked and limited conversation to collaborators on Dec 4, 2023
  18. converted this issue into a discussion #6 on Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions