• Air32F103/MH32F103

    From antispam@math.uni.wroc.pl@21:1/5 to All on Tue Jan 17 16:42:08 2023
    There is another STM clone on the market. Namely, one can buy
    board with chip marked Air32F103. Internet says that this is
    rebranded MH32F103. There is datasheet in Chinese which
    says that there are 5 variants of MH32F103, smallest one with
    32kB RAM and 128kB flash (that is what is sold as Air32F103)
    but there are bigger with RAM going up to 96kB and flash up
    to 1MB. I got Blue Pills which vendor maketed as "chinese STMF103".
    The chip on them reports 64kB RAM and 256kB flash. I think
    that this is next member of MH32F103 family. Namely, set of
    available devices matches MH32F103 and various tests (except for
    RAM and flash size) give the same results on Air32F103 and
    this chip.

    There is limited info on the net about those chips and in particular
    very little info in English, so I decided to share some information
    that I found out. First, there are incompatibilities with STM.
    For me biggest one is that compare output on channel 3 of timer 2
    (and probably also timers 3, 4, 5) does not work, it behaves like
    compare output was stuck at 0. Flags is interrupt register seem
    to change in right way, so actual compare probably works. And one
    can toggle output line by reconfiguring channel for negated output.
    But simple LED blinker which uses PWM mode of the timer does not
    work. Chinese info probably says about this, but I first discovered
    the problem and only after that I noticed that chinese text says
    something about channel 3 of timers 2-5 (I do not understand
    chinese so I do not know what exactly they say).

    There is other incompatiblity: NVIC has 71 positions and interrupt
    priorities have only 3 bits.

    OK, that are bad things that I found out. But there are also good
    things. MH32F103 can run at 216 MHz. Chinese datasheet says
    that above 2.3V flash has 0 wait states up to 108MHz and 1 wait
    state above 108MHz to 216MHz (and more when supply voltage is
    lower). Of course, bigger RAM and flash are good. MH32F103 has
    more devices than STM32F103CB: timers up to timer 7, second DMA
    controller, SPI3, DAC.

    I admit that some parameters look strange: real flash that fast
    looks unusual. OTOH datasheet says that smallest chip needs 300uS
    to wake up from deep sleep mode and bigger chips need 1200uS.
    This is much larger than corresponding time for STM32F103CB, but
    look too short for copy from flash to RAM used by GD32 processors.
    Also, voltage dependent wait states are normal for flash, but
    would be strange otherwise (as core and RAM is supplied at fixed
    voltage from internal regulator, so does not see changes in
    voltage).

    Let me also mention thing that other folks discovered: the chips
    actually have 97kB RAM. There is special unlock sequence
    (probably intended to be secret) that activates extra RAM.
    Again, it is not clear what it really means. One possibilty
    is that manufacturer uses the same die for different models.
    Since largest has 96kB RAM that would explain 96kB of extra
    RAM. Apparently manufacturer wanted extra private RAM for procedures
    in "system memory", that explains extra 1kB. But bigger models
    have more devices. One can see GPIO ports up to port G, so
    probably there is enough GPIO machinery for biggest model (which
    is 100 pin one). It is not clear about extra devices (apparently
    one can activate QSPI on smallest model...). Another question
    is flash: biggest model has 1MB flash. Do they put that much
    flash in all chips? Or maybe flash is on separate die,
    sized as needed?

    Anyway, this looks like interesting chip. Some info on the
    net:

    https://www.cnx-software.com/2022/11/21/air32f103-is-a-clone-of-stm32f103-clocked-at-up-to-216-mhz/

    chinese info about differences https://wiki.luatos.com/chips/air32f103/switchFromSxx.html

    report about extra memory
    http://www.hrrzi.com/2022/12/the-air32f103.html

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)