Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You will have many recoverable tape errors.


devel / comp.arch.embedded / Re: Another STM32F103 clone?

SubjectAuthor
* Another STM32F103 clone?antispam
+* Re: Another STM32F103 clone?Paul Rubin
|`- Re: Another STM32F103 clone?antispam
`* Re: Another STM32F103 clone?antispam
 `* Re: Another STM32F103 clone?Don Y
  `* Re: Another STM32F103 clone?antispam
   +* Re: Another STM32F103 clone?Rick C
   |`* Re: Another STM32F103 clone?antispam
   | +* Re: Another STM32F103 clone?Don Y
   | |`- Re: Another STM32F103 clone?Don Y
   | +* Re: Another STM32F103 clone?Rick C
   | |+* Re: Another STM32F103 clone?antispam
   | ||`- Re: Another STM32F103 clone?Don Y
   | |`* Re: Another STM32F103 clone?David Brown
   | | `* Re: Another STM32F103 clone?antispam
   | |  `- Re: Another STM32F103 clone?David Brown
   | `- Re: Another STM32F103 clone?Paul Rubin
   `* Re: Another STM32F103 clone?Don Y
    `* Re: Another STM32F103 clone?antispam
     `- Re: Another STM32F103 clone?Don Y

1
Another STM32F103 clone?

<tpddc3$1565$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1231&group=comp.arch.embedded#1231

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Another STM32F103 clone?
Date: Sun, 8 Jan 2023 03:30:11 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tpddc3$1565$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="38085"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
Cancel-Lock: sha1:ZPEdP3OKVJEohST39iBeBoT9iII=
X-Notice: Filtered by postfilter v. 0.9.2
 by: antis...@math.uni.wroc.pl - Sun, 8 Jan 2023 03:30 UTC

I have bought few Blue Pills on Aliexpress. I expected to receive
boards with some of known clones. But what I get does not look
like any clone that I have heard of:
- Cortex M4 with no FPU
- 32k RAM
- 128k flash
- set of devices like STM32F103C8T6

Chip seems to be resonable compatible, but I noticed notable
difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
seem to be stuck at 1 (this is reserved bit which in original chips
is 0). Peripherial address decoding seem to be partial, I can access
registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
RAM shows in 128k range, incrementing address by 32k modifies the
same memory.

Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
but GD docs claim extra features, apparently not present in this chip.

Does anybody heard of/seen chip with features above?

--
Waldek Hebisch

Re: Another STM32F103 clone?

<87o7r8byvt.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1233&group=comp.arch.embedded#1233

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Sun, 08 Jan 2023 11:38:14 -0800
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <87o7r8byvt.fsf@nightsong.com>
References: <tpddc3$1565$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="33be2025e05b5255b68e5d3704684dd0";
logging-data="4124855"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18APfDOjNmIc7cZR3ZYGI2o"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:Fh5LfDHAJQwCUAcvCARIB6fs9lU=
sha1:kmrvkXT9W5MykTB0SyO1GlqheSE=
 by: Paul Rubin - Sun, 8 Jan 2023 19:38 UTC

antispam@math.uni.wroc.pl writes:
> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> but GD docs claim extra features, apparently not present in this chip.
> Does anybody heard of/seen chip with features above?

https://www.cnx-software.com/2022/08/12/4-9-can-bus-module-features-gd32e103-cortex-m4-microcontroller/ ?

Re: Another STM32F103 clone?

<tpg0bi$6ls$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1234&group=comp.arch.embedded#1234

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Mon, 9 Jan 2023 03:06:26 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tpg0bi$6ls$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org> <87o7r8byvt.fsf@nightsong.com>
Injection-Info: gioia.aioe.org; logging-data="6844"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
Cancel-Lock: sha1:sE2qJQWbcFFaVlP537HJvNzAw7E=
X-Notice: Filtered by postfilter v. 0.9.2
 by: antis...@math.uni.wroc.pl - Mon, 9 Jan 2023 03:06 UTC

Paul Rubin <no.email@nospam.invalid> wrote:
> antispam@math.uni.wroc.pl writes:
> > Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> > but GD docs claim extra features, apparently not present in this chip.
> > Does anybody heard of/seen chip with features above?
>
> https://www.cnx-software.com/2022/08/12/4-9-can-bus-module-features-gd32e103-cortex-m4-microcontroller/ ?

I normally do not use CAN, but when I enabled clock to CAN I was
able to write to CAN memory on my chip. So CAN seem to be there.
In fact, usual F103C8 devices (SPI-s, I2C-s, UART-s, timers, DMA) do at
least something resonable, while other devices present in bigger
STM models and some clone chips seem to be not present (using
debugger to read registers give 0, attempt to write are ignored).

There is resonably strong hint that this is not a GD device, namely
JEDEC id is like in STM chips:

(gdb) x/8xw 0xE00FFFE0
0xe00fffe0: 0x00000010 0x00000004 0x0000000a 0x00000000
0xe00ffff0: 0x0000000d 0x00000010 0x00000005 0x000000b1

ROM table is:

(gdb) x/8xw 0xe00ff000
0xe00ff000: 0xfff0f003 0xfff02003 0xfff03003 0xfff01003
0xe00ff010: 0xfff41003 0xfff42003 0x00000000 0x00000000

Report in the net say that GD chips have GD id. HK also is reported
to have its id. Another clone has 0.

ATM I only found report about CS/CKS chips to present STM id. However, there
is claim that CS and CKS are the same chip and my CKS shows non-STM id
(59, I do not have id table to say what it means). OTOH id may be in flash,
in such case different chip batches may have different id-s...

--
Waldek Hebisch

Re: Another STM32F103 clone?

<tpi7l4$qe3$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1235&group=comp.arch.embedded#1235

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Mon, 9 Jan 2023 23:23:16 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tpi7l4$qe3$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org>
Injection-Info: gioia.aioe.org; logging-data="27075"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
Cancel-Lock: sha1:3oaDwwDj9P8sf4x6oCkMv3RuR5g=
X-Notice: Filtered by postfilter v. 0.9.2
 by: antis...@math.uni.wroc.pl - Mon, 9 Jan 2023 23:23 UTC

antispam@math.uni.wroc.pl wrote:
> I have bought few Blue Pills on Aliexpress. I expected to receive
> boards with some of known clones. But what I get does not look
> like any clone that I have heard of:
> - Cortex M4 with no FPU
> - 32k RAM
> - 128k flash
> - set of devices like STM32F103C8T6
>
> Chip seems to be resonable compatible, but I noticed notable
> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
> seem to be stuck at 1 (this is reserved bit which in original chips
> is 0). Peripherial address decoding seem to be partial, I can access
> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
> RAM shows in 128k range, incrementing address by 32k modifies the
> same memory.
>
> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> but GD docs claim extra features, apparently not present in this chip.
>
> Does anybody heard of/seen chip with features above?

Info on internet mentions about 15 diffrenet Chinese manufacturers
cloning STM chips. One of them is Flashchip. My chip seem to
match id of FCM32F103C:

(gdb) x/2xw 0x1FFFF7C0
0x1ffff7c0: 0x46433332 0x0046103c

which appears in FSM32F103C migration note. This is one of few
F103 compatible processors with M4 core, has 128kB flash. The
migration note claims 20 kB RAM, my test indicate 32kB. More
precisely, my test routine wrote to words from 0x20000400 to
0x20008000 and checked that written value is there. This was
repeated for two different values. So I have rather strong
indication that chip really have 32kB RAM (ok, test only covered
31kB, but first 1kB contained test program which apparently
run correctly). Maybe manufactures claim 20kB because this
is all what STM32F103CB has.

--
Waldek Hebisch

Re: Another STM32F103 clone?

<tpic2h$b04f$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1236&group=comp.arch.embedded#1236

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Mon, 9 Jan 2023 17:38:38 -0700
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <tpic2h$b04f$1@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 10 Jan 2023 00:38:42 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="095e468744b09f724f3682b7056b37d8";
logging-data="360591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hEBW82CC1JovGLtnvwQ3K"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:R0zZdkuxT26azp/hPk0BaZ+sNv4=
Content-Language: en-US
In-Reply-To: <tpi7l4$qe3$1@gioia.aioe.org>
 by: Don Y - Tue, 10 Jan 2023 00:38 UTC

On 1/9/2023 4:23 PM, antispam@math.uni.wroc.pl wrote:
> antispam@math.uni.wroc.pl wrote:
>> I have bought few Blue Pills on Aliexpress. I expected to receive
>> boards with some of known clones. But what I get does not look
>> like any clone that I have heard of:
>> - Cortex M4 with no FPU
>> - 32k RAM
>> - 128k flash
>> - set of devices like STM32F103C8T6
>>
>> Chip seems to be resonable compatible, but I noticed notable
>> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
>> seem to be stuck at 1 (this is reserved bit which in original chips
>> is 0). Peripherial address decoding seem to be partial, I can access
>> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
>> RAM shows in 128k range, incrementing address by 32k modifies the
>> same memory.
>>
>> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
>> but GD docs claim extra features, apparently not present in this chip.
>>
>> Does anybody heard of/seen chip with features above?
>
> Info on internet mentions about 15 diffrenet Chinese manufacturers
> cloning STM chips. One of them is Flashchip. My chip seem to
> match id of FCM32F103C:
>
> (gdb) x/2xw 0x1FFFF7C0
> 0x1ffff7c0: 0x46433332 0x0046103c
>
> which appears in FSM32F103C migration note. This is one of few
> F103 compatible processors with M4 core, has 128kB flash. The
> migration note claims 20 kB RAM, my test indicate 32kB. More
> precisely, my test routine wrote to words from 0x20000400 to
> 0x20008000 and checked that written value is there. This was
> repeated for two different values. So I have rather strong
> indication that chip really have 32kB RAM (ok, test only covered
> 31kB, but first 1kB contained test program which apparently
> run correctly). Maybe manufactures claim 20kB because this
> is all what STM32F103CB has.

Build a random number generator with a long, relatively prime period.
Fill memory with successive values from that RNG. (The primeness
ensures the pattern doesn't repeat at intervals that might be
related to the addressing decoder)

Reseed the RNG and run it, again -- this time checking values
read from sequential locations against the computed random number.
The first fault indicates an unexpected decoder error (i.e.,
the address space "wrapping" at that value), a fault in the
memory (I use this technique as a quick memory test) *or*
the end of physical memory.

[You can, of course, do this ad hoc with a pattern that you
create that has some relatively prime periodicity. But, it
will likely have no subsequent value in your toolkit.]

Re: Another STM32F103 clone?

<tpqfk0$77v$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1237&group=comp.arch.embedded#1237

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Fri, 13 Jan 2023 02:28:16 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tpqfk0$77v$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org> <tpic2h$b04f$1@dont-email.me>
Injection-Info: gioia.aioe.org; logging-data="7423"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:BxvtUNDMHrTqCR9hhLVgMqA/mbw=
 by: antis...@math.uni.wroc.pl - Fri, 13 Jan 2023 02:28 UTC

Don Y <blockedofcourse@foo.invalid> wrote:
> On 1/9/2023 4:23 PM, antispam@math.uni.wroc.pl wrote:
> > antispam@math.uni.wroc.pl wrote:
> >> I have bought few Blue Pills on Aliexpress. I expected to receive
> >> boards with some of known clones. But what I get does not look
> >> like any clone that I have heard of:
> >> - Cortex M4 with no FPU
> >> - 32k RAM
> >> - 128k flash
> >> - set of devices like STM32F103C8T6
> >>
> >> Chip seems to be resonable compatible, but I noticed notable
> >> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
> >> seem to be stuck at 1 (this is reserved bit which in original chips
> >> is 0). Peripherial address decoding seem to be partial, I can access
> >> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
> >> RAM shows in 128k range, incrementing address by 32k modifies the
> >> same memory.
> >>
> >> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> >> but GD docs claim extra features, apparently not present in this chip.
> >>
> >> Does anybody heard of/seen chip with features above?
> >
> > Info on internet mentions about 15 diffrenet Chinese manufacturers
> > cloning STM chips. One of them is Flashchip. My chip seem to
> > match id of FCM32F103C:
> >
> > (gdb) x/2xw 0x1FFFF7C0
> > 0x1ffff7c0: 0x46433332 0x0046103c
> >
> > which appears in FSM32F103C migration note. This is one of few
> > F103 compatible processors with M4 core, has 128kB flash. The
> > migration note claims 20 kB RAM, my test indicate 32kB. More
> > precisely, my test routine wrote to words from 0x20000400 to
> > 0x20008000 and checked that written value is there. This was
> > repeated for two different values. So I have rather strong
> > indication that chip really have 32kB RAM (ok, test only covered
> > 31kB, but first 1kB contained test program which apparently
> > run correctly). Maybe manufactures claim 20kB because this
> > is all what STM32F103CB has.
>
> Build a random number generator with a long, relatively prime period.
> Fill memory with successive values from that RNG. (The primeness
> ensures the pattern doesn't repeat at intervals that might be
> related to the addressing decoder)
>
> Reseed the RNG and run it, again -- this time checking values
> read from sequential locations against the computed random number.
> The first fault indicates an unexpected decoder error (i.e.,
> the address space "wrapping" at that value), a fault in the
> memory (I use this technique as a quick memory test) *or*
> the end of physical memory.

Long period is easy: I used a counter, actually 3 versions
of counter. One version of counter used large increment which
ensured that all bytes were changing quickly (with low increments
there were long streches were high bytes were the same).

I also tried 3 lousy random number generators,
but in this problem I do not think that much more testing is
needed: AFAICS to pass my test with less memory chip would need
quite complicated address remapping working at bit level.
It does not make sense to put such circuit on the chip and
probably it is infeasible with chip technology.

I double that lousy random number generators will be of
much use in future. But writing a good one is more work,
and even linking to some has disadvantage of size: memory
taken by test program was excluded from modification so
I wanted test program to be as small as possible. My program
was 680 bytes which together with varibles and stack comfortably
fit in 1kB of RAM...

--
Waldek Hebisch

Re: Another STM32F103 clone?

<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1238&group=comp.arch.embedded#1238

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:ae9:c119:0:b0:706:49fb:8049 with SMTP id z25-20020ae9c119000000b0070649fb8049mr112283qki.36.1673842177624;
Sun, 15 Jan 2023 20:09:37 -0800 (PST)
X-Received: by 2002:a0c:fb49:0:b0:534:c264:5ec3 with SMTP id
b9-20020a0cfb49000000b00534c2645ec3mr172852qvq.42.1673842177298; Sun, 15 Jan
2023 20:09:37 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Sun, 15 Jan 2023 20:09:37 -0800 (PST)
In-Reply-To: <tpqfk0$77v$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=24.50.235.150; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 24.50.235.150
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
Subject: Re: Another STM32F103 clone?
From: gnuarm.d...@gmail.com (Rick C)
Injection-Date: Mon, 16 Jan 2023 04:09:37 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 5301
 by: Rick C - Mon, 16 Jan 2023 04:09 UTC

On Thursday, January 12, 2023 at 10:28:21 PM UTC-4, anti...@math.uni.wroc.pl wrote:
> Don Y <blocked...@foo.invalid> wrote:
> > On 1/9/2023 4:23 PM, anti...@math.uni.wroc.pl wrote:
> > > anti...@math.uni.wroc.pl wrote:
> > >> I have bought few Blue Pills on Aliexpress. I expected to receive
> > >> boards with some of known clones. But what I get does not look
> > >> like any clone that I have heard of:
> > >> - Cortex M4 with no FPU
> > >> - 32k RAM
> > >> - 128k flash
> > >> - set of devices like STM32F103C8T6
> > >>
> > >> Chip seems to be resonable compatible, but I noticed notable
> > >> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
> > >> seem to be stuck at 1 (this is reserved bit which in original chips
> > >> is 0). Peripherial address decoding seem to be partial, I can access
> > >> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
> > >> RAM shows in 128k range, incrementing address by 32k modifies the
> > >> same memory.
> > >>
> > >> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> > >> but GD docs claim extra features, apparently not present in this chip.
> > >>
> > >> Does anybody heard of/seen chip with features above?
> > >
> > > Info on internet mentions about 15 diffrenet Chinese manufacturers
> > > cloning STM chips. One of them is Flashchip. My chip seem to
> > > match id of FCM32F103C:
> > >
> > > (gdb) x/2xw 0x1FFFF7C0
> > > 0x1ffff7c0: 0x46433332 0x0046103c
> > >
> > > which appears in FSM32F103C migration note. This is one of few
> > > F103 compatible processors with M4 core, has 128kB flash. The
> > > migration note claims 20 kB RAM, my test indicate 32kB. More
> > > precisely, my test routine wrote to words from 0x20000400 to
> > > 0x20008000 and checked that written value is there. This was
> > > repeated for two different values. So I have rather strong
> > > indication that chip really have 32kB RAM (ok, test only covered
> > > 31kB, but first 1kB contained test program which apparently
> > > run correctly). Maybe manufactures claim 20kB because this
> > > is all what STM32F103CB has.
> >
> > Build a random number generator with a long, relatively prime period.
> > Fill memory with successive values from that RNG. (The primeness
> > ensures the pattern doesn't repeat at intervals that might be
> > related to the addressing decoder)
> >
> > Reseed the RNG and run it, again -- this time checking values
> > read from sequential locations against the computed random number.
> > The first fault indicates an unexpected decoder error (i.e.,
> > the address space "wrapping" at that value), a fault in the
> > memory (I use this technique as a quick memory test) *or*
> > the end of physical memory.
> Long period is easy: I used a counter, actually 3 versions
> of counter. One version of counter used large increment which
> ensured that all bytes were changing quickly (with low increments
> there were long streches were high bytes were the same).
>
> I also tried 3 lousy random number generators,
> but in this problem I do not think that much more testing is
> needed: AFAICS to pass my test with less memory chip would need
> quite complicated address remapping working at bit level.
> It does not make sense to put such circuit on the chip and
> probably it is infeasible with chip technology.
>
> I double that lousy random number generators will be of
> much use in future. But writing a good one is more work,
> and even linking to some has disadvantage of size: memory
> taken by test program was excluded from modification so
> I wanted test program to be as small as possible. My program
> was 680 bytes which together with varibles and stack comfortably
> fit in 1kB of RAM...

What's wrong with an LFSR? They are very simple and have relatively good pseudo-random properties. What, by your definition, is a "good" or a "lousy" RNG?

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209

Re: Another STM32F103 clone?

<tq2ruu$2ld9q$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1240&group=comp.arch.embedded#1240

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Sun, 15 Jan 2023 23:47:56 -0700
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <tq2ruu$2ld9q$1@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 16 Jan 2023 06:47:59 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="24aa05890680fec02efec70ef3752edb";
logging-data="2798906"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lELyx231pn2SKICTl9uXO"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:tIi8eVAXN7g8nwI01dWsDSpygEA=
In-Reply-To: <tpqfk0$77v$1@gioia.aioe.org>
Content-Language: en-US
 by: Don Y - Mon, 16 Jan 2023 06:47 UTC

On 1/12/2023 7:28 PM, antispam@math.uni.wroc.pl wrote:
>> Build a random number generator with a long, relatively prime period.
>> Fill memory with successive values from that RNG. (The primeness
>> ensures the pattern doesn't repeat at intervals that might be
>> related to the addressing decoder)
>>
>> Reseed the RNG and run it, again -- this time checking values
>> read from sequential locations against the computed random number.
>> The first fault indicates an unexpected decoder error (i.e.,
>> the address space "wrapping" at that value), a fault in the
>> memory (I use this technique as a quick memory test) *or*
>> the end of physical memory.
>
> Long period is easy:

"Long" isn't the critical aspect. What you want is a period that is
"relatively prime" wrt the likely address decoding. So, a write of
"random value X" to location N can't appear at any LIKELY "bad decode"
or that address, elsehwere in the address space you are probing.

> I used a counter, actually 3 versions
> of counter. One version of counter used large increment which
> ensured that all bytes were changing quickly (with low increments
> there were long streches were high bytes were the same).

A generic random number generator doesn't confine changes
to "local regions" of the value. E.g.,
00000101
00001010
00010100
00101001
01010011
10100110
The goal being that bits/bytes don't repeat "regularly"
and that every bit sees some activity, in any set of
consecutively generated values.

> I also tried 3 lousy random number generators,
> but in this problem I do not think that much more testing is
> needed: AFAICS to pass my test with less memory chip would need
> quite complicated address remapping working at bit level.

Quite possible. I was merely offering a tool that one can
fall back on in these sorts of problems. I use this to
size and grossly test memory at POST; some number of passes
of writes with LATER read-verifies to ensure data is
retained and there are no decode failures (e.g., caused
by passing the end of physical memory).

I learned this trick from a friend from school, in the video
(arcade) game heyday -- you don't have a lot of resources
*or* time to do comprehensive tests. Yet, you have to have
a reasonable level of confidence that the game is working
properly (folks get mad if you accept their coins and
don't deliver the product/experience!)

[When the memory being tested is a frame-buffer, the
displayed values resemble a textured "carpet" of colors]

> It does not make sense to put such circuit on the chip and
> probably it is infeasible with chip technology.
>
> I double that lousy random number generators will be of
> much use in future. But writing a good one is more work,
> and even linking to some has disadvantage of size: memory
> taken by test program was excluded from modification so
> I wanted test program to be as small as possible. My program
> was 680 bytes which together with varibles and stack comfortably
> fit in 1kB of RAM...

The RNG isn't a big piece of code. And, can be parameterized
to fit your future needs.

Re: Another STM32F103 clone?

<tq4r09$1uu5$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1241&group=comp.arch.embedded#1241

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 00:43:53 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tq4r09$1uu5$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org> <tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org> <eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="64453"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
Cancel-Lock: sha1:5UrYr8f7B/S+YkokaXAyGMlMWfI=
X-Notice: Filtered by postfilter v. 0.9.2
 by: antis...@math.uni.wroc.pl - Tue, 17 Jan 2023 00:43 UTC

Rick C <gnuarm.deletethisbit@gmail.com> wrote:
> On Thursday, January 12, 2023 at 10:28:21 PM UTC-4, anti...@math.uni.wroc.pl wrote:
> > Don Y <blocked...@foo.invalid> wrote:
> > > On 1/9/2023 4:23 PM, anti...@math.uni.wroc.pl wrote:
> > > > anti...@math.uni.wroc.pl wrote:
> > > >> I have bought few Blue Pills on Aliexpress. I expected to receive
> > > >> boards with some of known clones. But what I get does not look
> > > >> like any clone that I have heard of:
> > > >> - Cortex M4 with no FPU
> > > >> - 32k RAM
> > > >> - 128k flash
> > > >> - set of devices like STM32F103C8T6
> > > >>
> > > >> Chip seems to be resonable compatible, but I noticed notable
> > > >> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
> > > >> seem to be stuck at 1 (this is reserved bit which in original chips
> > > >> is 0). Peripherial address decoding seem to be partial, I can access
> > > >> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
> > > >> RAM shows in 128k range, incrementing address by 32k modifies the
> > > >> same memory.
> > > >>
> > > >> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> > > >> but GD docs claim extra features, apparently not present in this chip.
> > > >>
> > > >> Does anybody heard of/seen chip with features above?
> > > >
> > > > Info on internet mentions about 15 diffrenet Chinese manufacturers
> > > > cloning STM chips. One of them is Flashchip. My chip seem to
> > > > match id of FCM32F103C:
> > > >
> > > > (gdb) x/2xw 0x1FFFF7C0
> > > > 0x1ffff7c0: 0x46433332 0x0046103c
> > > >
> > > > which appears in FSM32F103C migration note. This is one of few
> > > > F103 compatible processors with M4 core, has 128kB flash. The
> > > > migration note claims 20 kB RAM, my test indicate 32kB. More
> > > > precisely, my test routine wrote to words from 0x20000400 to
> > > > 0x20008000 and checked that written value is there. This was
> > > > repeated for two different values. So I have rather strong
> > > > indication that chip really have 32kB RAM (ok, test only covered
> > > > 31kB, but first 1kB contained test program which apparently
> > > > run correctly). Maybe manufactures claim 20kB because this
> > > > is all what STM32F103CB has.
> > >
> > > Build a random number generator with a long, relatively prime period.
> > > Fill memory with successive values from that RNG. (The primeness
> > > ensures the pattern doesn't repeat at intervals that might be
> > > related to the addressing decoder)
> > >
> > > Reseed the RNG and run it, again -- this time checking values
> > > read from sequential locations against the computed random number.
> > > The first fault indicates an unexpected decoder error (i.e.,
> > > the address space "wrapping" at that value), a fault in the
> > > memory (I use this technique as a quick memory test) *or*
> > > the end of physical memory.
> > Long period is easy: I used a counter, actually 3 versions
> > of counter. One version of counter used large increment which
> > ensured that all bytes were changing quickly (with low increments
> > there were long streches were high bytes were the same).
> >
> > I also tried 3 lousy random number generators,
> > but in this problem I do not think that much more testing is
> > needed: AFAICS to pass my test with less memory chip would need
> > quite complicated address remapping working at bit level.
> > It does not make sense to put such circuit on the chip and
> > probably it is infeasible with chip technology.
> >
> > I double that lousy random number generators will be of
> > much use in future. But writing a good one is more work,
> > and even linking to some has disadvantage of size: memory
> > taken by test program was excluded from modification so
> > I wanted test program to be as small as possible. My program
> > was 680 bytes which together with varibles and stack comfortably
> > fit in 1kB of RAM...
>
> What's wrong with an LFSR? They are very simple and have relatively good pseudo-random properties. What, by your definition, is a "good" or a "lousy" RNG?
>

"lousy" RNG fails relatively simple statistic tests. That includes
LFSR in its usual incarnations. By chance, I have found paper
about random number generators which presents results of some
tests and proposes a different generator. There is related site:

https://pcg-random.org

I am not sure if this one is really good, but the material they
present shows weaknesses of many others.

--
Waldek Hebisch

Re: Another STM32F103 clone?

<tq51oq$32g1k$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1243&group=comp.arch.embedded#1243

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Mon, 16 Jan 2023 19:39:21 -0700
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <tq51oq$32g1k$2@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
<tq4r09$1uu5$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 17 Jan 2023 02:39:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3362025d40248a51fac28bde56f28df2";
logging-data="3227700"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PhbCpEAXHuCYuvwz6p9hJ"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:ZCSHULGe5j9kFtqeC3agseMokNc=
Content-Language: en-US
In-Reply-To: <tq4r09$1uu5$1@gioia.aioe.org>
 by: Don Y - Tue, 17 Jan 2023 02:39 UTC

On 1/16/2023 5:43 PM, antispam@math.uni.wroc.pl wrote:
> "lousy" RNG fails relatively simple statistic tests. That includes
> LFSR in its usual incarnations. By chance, I have found paper
> about random number generators which presents results of some
> tests and proposes a different generator. There is related site:
>
> https://pcg-random.org
>
> I am not sure if this one is really good, but the material they
> present shows weaknesses of many others.

You don't really care if the data is random. In fact, it isn't,
and you don't want it to be (because you want to be able to
reconstruct the exact same sequence to VERIFY the contents of
the memory you've just filled with it!

What you are after is a non-repeating pattern that could mask address
decode errors or failed memory cells.

E.g., if you run the RNG three times, you would expect each bit in the
memory to have seen a '1' and a '0' value -- without having to verify
that assumption analytically.

"Truly" random numbers are hard to come by as they need a source
of entropy that can not be "influenced" by external conditions.

In the 60's and 70's, electromechanical pinball machines had a
"match" feature that rewarded "lucky" players with a free game
at the end of their game. This was awarded if the last two digits
of the player's score "matched" the two digits "randomly"
generated by the machine. As the rightmost of those digits was
always '0', this basically gave you a 1-in-10 chance of winning.

But, the "random number generator" was a sequencer mechanism that
was pulsed (advanced) by discrete events that happened during the
game. E.g., every time the ball hit this target. Or, that. Or,
some combination. As the ball travels at finite, observable
speeds, a player could predict (reliably!) what the current
mechanical position of that mechanism happened to be. So, when
your current score happened to coincide with the current *setting*,
you simply TILTed the game (so no further action would influence
that mechanism). And, "won" a free game!

If you visit gaming establishments (casinos), you will find
all sorts of losers^H^H^H users who are *sure* they know
how their machine works and are "priming" it for the next
payout: "It's just about ready to hit!" Or, someone
who walks away from a machine and watches the next player "hit"
a megajackpot: "Oh, if I had just played one more coin..."

No, there's nothing you can do to influence the randomness
of the game. If there was, the casino operator would be at
risk of that "secret" getting out and changing the returns
on his machines!

Part of the design process is to ensure you have a "truly"
random number generator as the rest of the machine is just
"decoration" to present that random number in a way that
convinces you of your luck (or misguided EFFORT). Entertainment
value. The machine already knows if you've won or lost long
before the results are "displayed".

[Amusingly, some machines try to play on the expectations
of the player unfairly. E.g., displaying playing cards
as if the game followed the same rules as a deck of cards
(when, in fact, it doesn't; it could show 4 aces with
a probability of 1/100^4 instead of 1/(52*51*50*49) and
payout at some rate that doesn't represent the "real world"
odds of achieving that feat!). How many U's in "sucker"?]

Re: Another STM32F103 clone?

<tq521h$32g1k$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1244&group=comp.arch.embedded#1244

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Mon, 16 Jan 2023 19:44:00 -0700
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <tq521h$32g1k$3@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
<tq4r09$1uu5$1@gioia.aioe.org> <tq51oq$32g1k$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 17 Jan 2023 02:44:02 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3362025d40248a51fac28bde56f28df2";
logging-data="3227700"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PkWoUTMQS5mIRT4WaUwnN"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:oy9BOBjSrVQpR7gnDgfDMmnIHQk=
Content-Language: en-US
In-Reply-To: <tq51oq$32g1k$2@dont-email.me>
 by: Don Y - Tue, 17 Jan 2023 02:44 UTC

On 1/16/2023 7:39 PM, Don Y wrote:
> [Amusingly, some machines try to play on the expectations
> of the player unfairly.  E.g., displaying playing cards
> as if the game followed the same rules as a deck of cards
> (when, in fact, it doesn't; it could show 4 aces with
> a probability of 1/100^4 instead of 1/(52*51*50*49) and
> payout at some rate that doesn't represent the "real world"
> odds of achieving that feat!).  How many U's in "sucker"?]

Ugh! That numerator should be 4*3*2...

Re: Another STM32F103 clone?

<065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1245&group=comp.arch.embedded#1245

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:a05:620a:164d:b0:706:92f3:12ac with SMTP id c13-20020a05620a164d00b0070692f312acmr79483qko.175.1673932030477;
Mon, 16 Jan 2023 21:07:10 -0800 (PST)
X-Received: by 2002:ac8:7744:0:b0:3ad:7472:a9a8 with SMTP id
g4-20020ac87744000000b003ad7472a9a8mr58316qtu.301.1673932030201; Mon, 16 Jan
2023 21:07:10 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Mon, 16 Jan 2023 21:07:10 -0800 (PST)
In-Reply-To: <tq4r09$1uu5$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=24.50.235.150; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 24.50.235.150
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com> <tq4r09$1uu5$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>
Subject: Re: Another STM32F103 clone?
From: gnuarm.d...@gmail.com (Rick C)
Injection-Date: Tue, 17 Jan 2023 05:07:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6980
 by: Rick C - Tue, 17 Jan 2023 05:07 UTC

On Monday, January 16, 2023 at 8:43:58 PM UTC-4, anti...@math.uni.wroc.pl wrote:
> Rick C <gnuarm.del...@gmail.com> wrote:
> > On Thursday, January 12, 2023 at 10:28:21 PM UTC-4, anti...@math.uni.wroc.pl wrote:
> > > Don Y <blocked...@foo.invalid> wrote:
> > > > On 1/9/2023 4:23 PM, anti...@math.uni.wroc.pl wrote:
> > > > > anti...@math.uni.wroc.pl wrote:
> > > > >> I have bought few Blue Pills on Aliexpress. I expected to receive
> > > > >> boards with some of known clones. But what I get does not look
> > > > >> like any clone that I have heard of:
> > > > >> - Cortex M4 with no FPU
> > > > >> - 32k RAM
> > > > >> - 128k flash
> > > > >> - set of devices like STM32F103C8T6
> > > > >>
> > > > >> Chip seems to be resonable compatible, but I noticed notable
> > > > >> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
> > > > >> seem to be stuck at 1 (this is reserved bit which in original chips
> > > > >> is 0). Peripherial address decoding seem to be partial, I can access
> > > > >> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
> > > > >> RAM shows in 128k range, incrementing address by 32k modifies the
> > > > >> same memory.
> > > > >>
> > > > >> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> > > > >> but GD docs claim extra features, apparently not present in this chip.
> > > > >>
> > > > >> Does anybody heard of/seen chip with features above?
> > > > >
> > > > > Info on internet mentions about 15 diffrenet Chinese manufacturers
> > > > > cloning STM chips. One of them is Flashchip. My chip seem to
> > > > > match id of FCM32F103C:
> > > > >
> > > > > (gdb) x/2xw 0x1FFFF7C0
> > > > > 0x1ffff7c0: 0x46433332 0x0046103c
> > > > >
> > > > > which appears in FSM32F103C migration note. This is one of few
> > > > > F103 compatible processors with M4 core, has 128kB flash. The
> > > > > migration note claims 20 kB RAM, my test indicate 32kB. More
> > > > > precisely, my test routine wrote to words from 0x20000400 to
> > > > > 0x20008000 and checked that written value is there. This was
> > > > > repeated for two different values. So I have rather strong
> > > > > indication that chip really have 32kB RAM (ok, test only covered
> > > > > 31kB, but first 1kB contained test program which apparently
> > > > > run correctly). Maybe manufactures claim 20kB because this
> > > > > is all what STM32F103CB has.
> > > >
> > > > Build a random number generator with a long, relatively prime period.
> > > > Fill memory with successive values from that RNG. (The primeness
> > > > ensures the pattern doesn't repeat at intervals that might be
> > > > related to the addressing decoder)
> > > >
> > > > Reseed the RNG and run it, again -- this time checking values
> > > > read from sequential locations against the computed random number.
> > > > The first fault indicates an unexpected decoder error (i.e.,
> > > > the address space "wrapping" at that value), a fault in the
> > > > memory (I use this technique as a quick memory test) *or*
> > > > the end of physical memory.
> > > Long period is easy: I used a counter, actually 3 versions
> > > of counter. One version of counter used large increment which
> > > ensured that all bytes were changing quickly (with low increments
> > > there were long streches were high bytes were the same).
> > >
> > > I also tried 3 lousy random number generators,
> > > but in this problem I do not think that much more testing is
> > > needed: AFAICS to pass my test with less memory chip would need
> > > quite complicated address remapping working at bit level.
> > > It does not make sense to put such circuit on the chip and
> > > probably it is infeasible with chip technology.
> > >
> > > I double that lousy random number generators will be of
> > > much use in future. But writing a good one is more work,
> > > and even linking to some has disadvantage of size: memory
> > > taken by test program was excluded from modification so
> > > I wanted test program to be as small as possible. My program
> > > was 680 bytes which together with varibles and stack comfortably
> > > fit in 1kB of RAM...
> >
> > What's wrong with an LFSR? They are very simple and have relatively good pseudo-random properties. What, by your definition, is a "good" or a "lousy" RNG?
> >
> "lousy" RNG fails relatively simple statistic tests. That includes
> LFSR in its usual incarnations. By chance, I have found paper
> about random number generators which presents results of some
> tests and proposes a different generator. There is related site:
>
> https://pcg-random.org
>
> I am not sure if this one is really good, but the material they
> present shows weaknesses of many others.

Maybe I didn't read the thread well enough, but I thought this was just a way to generate addresses to test RAM, no? The only specific property I've seen is that it be "relatively prime" to the memory address space. LFSR certainly can manage that. Heck, a Grey code can probably manage that.

With 17 bits, I can generate a PR sequence that is relatively prime to powers of 2 and of length 82,677.

Am I missing something important?

--

Rick C.

+ Get 1,000 miles of free Supercharging
+ Tesla referral code - https://ts.la/richard11209

Re: Another STM32F103 clone?

<tq5ce8$vfm$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1246&group=comp.arch.embedded#1246

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 05:41:28 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tq5ce8$vfm$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org> <tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org> <tq2ruu$2ld9q$1@dont-email.me>
Injection-Info: gioia.aioe.org; logging-data="32246"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:hCoxBbsYGiLbs4wPaMPVn8oJjMc=
 by: antis...@math.uni.wroc.pl - Tue, 17 Jan 2023 05:41 UTC

Don Y <blockedofcourse@foo.invalid> wrote:
> On 1/12/2023 7:28 PM, antispam@math.uni.wroc.pl wrote:
> >> Build a random number generator with a long, relatively prime period.
> >> Fill memory with successive values from that RNG. (The primeness
> >> ensures the pattern doesn't repeat at intervals that might be
> >> related to the addressing decoder)
> >>
> >> Reseed the RNG and run it, again -- this time checking values
> >> read from sequential locations against the computed random number.
> >> The first fault indicates an unexpected decoder error (i.e.,
> >> the address space "wrapping" at that value), a fault in the
> >> memory (I use this technique as a quick memory test) *or*
> >> the end of physical memory.
> >
> > Long period is easy:
>
> "Long" isn't the critical aspect. What you want is a period that is
> "relatively prime" wrt the likely address decoding. So, a write of
> "random value X" to location N can't appear at any LIKELY "bad decode"
> or that address, elsehwere in the address space you are probing.

I do not see "relatively prime" as really helpful. I mean:
I would use only tiny part of period, so for purpose of memory
testing it does not matter too much.
> > I used a counter, actually 3 versions
> > of counter. One version of counter used large increment which
> > ensured that all bytes were changing quickly (with low increments
> > there were long streches were high bytes were the same).
>
> A generic random number generator doesn't confine changes
> to "local regions" of the value. E.g.,
> 00000101
> 00001010
> 00010100
> 00101001
> 01010011
> 10100110
> The goal being that bits/bytes don't repeat "regularly"
> and that every bit sees some activity, in any set of
> consecutively generated values.

Do you realize that popular PRNG-s are perfectly regular using
relatively simple rules? Better play tricks so that is
hard to detect this regularity. My first two counters
had problem that low order bits were changing with small
periods, third one counted modulo a prime. When viewed
as numbers, once you knew the rule it was perfectly
regular (and probably guessing the rule would be not
that hard). At bit level carries and modulo meant
that logic working on separate bits or small groups of
bits would have trouble following/predicting the
sequence.

> > I also tried 3 lousy random number generators,
> > but in this problem I do not think that much more testing is
> > needed: AFAICS to pass my test with less memory chip would need
> > quite complicated address remapping working at bit level.
>
> Quite possible. I was merely offering a tool that one can
> fall back on in these sorts of problems. I use this to
> size and grossly test memory at POST; some number of passes
> of writes with LATER read-verifies to ensure data is
> retained and there are no decode failures (e.g., caused
> by passing the end of physical memory).
>
> I learned this trick from a friend from school, in the video
> (arcade) game heyday -- you don't have a lot of resources
> *or* time to do comprehensive tests. Yet, you have to have
> a reasonable level of confidence that the game is working
> properly (folks get mad if you accept their coins and
> don't deliver the product/experience!)

If I what I wrote sounded negative, let me say that I in
general have doubts about efficiency of many tests. For
example, I waited on PC-s doing POST. Yet, I saw failing
POST maybe one or two times and IIRC errors were so gross
that very simple and much faster test should catch them.
OTOH I have seem machines which passed POST but failed more
comprehensive memory test. And machines that in use exhibited
what looked like memory errors but passed available tests
(I "cured" few by underclocking them).

In software context I saw projects that religiously added
tests to have "100% test coverage", yet those tests were
too weak to catch major breakage. OTOH I also had
situations were _new_ approach to testing allowed to
identify and consequently fix several bugs.

One approach to testing which is reasonably effective
is to first identify likely "failure modes" and invent
tests that detects specific failure mode. In this case
possible "failure mode" was some address scrambling
scheme. In fact there is some kind of "scrambling",
namely chip seem to use incomplete address decoding.
Now, for scrambling at word level already simplest
counter would detect it. That still leaves possiblity
of scrambling at byte or bit level. In particular,
only carries prevent periodicity with period 256 and
limited number of un-aliased extra cells possibly
could handle places where carries occur. Second test
had much more carries, making this highly unlikely.
In third counter no bit position was periodic and
carries were in different places than second test.
So scrambling scheme that passes all 3 counter
test is getting more weird. Now, address decoding
lies on performence critical path. MCU manufactur
needs good reason to put extra logic there. Skipping
gates and using incomplete decoding is cheap. I am
not sure if there is good reason to add any scrambling
beyond incomplete decoding. But certainly there is
no reason to add several complicated scrambling circuits
working differently on different byte (or bit) planes.

Also, goal of my testing was to find out if extra memory
is there. Once you accept that there is 32kB of memory
natural question is why manufactures says that there is
20KB. One possible answer is that manufactures does not
test extra memory. So one may further ask if extra
memory works reliably. Answering this last question
goes well beyond goal of my testing, it is much bigger
project and to that matter even if it works reliably for
me it does not prove that it will work reliably for
other people.

> > I double that lousy random number generators will be of
> > much use in future. But writing a good one is more work,
> > and even linking to some has disadvantage of size: memory
> > taken by test program was excluded from modification so
> > I wanted test program to be as small as possible. My program
> > was 680 bytes which together with varibles and stack comfortably
> > fit in 1kB of RAM...
>
> The RNG isn't a big piece of code. And, can be parameterized
> to fit your future needs.

Mersenne twister which is present in several libraries has
rather large state and long code. I am not sure how large
exactly it is but my impression was that its state consists
of hundreds of 64-bit integers...

And concerning needs, FCM32 can efficiently do 64-bit arithmetic.
Already Cortex-M0 will have suboptimal performance with 64-bit
numbers. And on 8-bitters or processors like smallest MSP430
which lack hardware multiplication arithmetic on bigger numbers
can be quite expensive. Hence, PRNG which works fast on big
machines could be quite slow on small machines. Up to now
I did not reall need PRNG on small machines, so I postponed
implementing one. If/when I have need I will know which
compromises/tradeoffs are appropriate for given application.

--
Waldek Hebisch

Re: Another STM32F103 clone?

<tq5dou$1bcn$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1247&group=comp.arch.embedded#1247

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 06:04:14 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tq5dou$1bcn$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org> <tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org> <eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com> <tq4r09$1uu5$1@gioia.aioe.org> <065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>
Injection-Info: gioia.aioe.org; logging-data="44439"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:TKRRNl4ouwOb0SeotC7P1P2vGWM=
 by: antis...@math.uni.wroc.pl - Tue, 17 Jan 2023 06:04 UTC

Rick C <gnuarm.deletethisbit@gmail.com> wrote:
> On Monday, January 16, 2023 at 8:43:58 PM UTC-4, anti...@math.uni.wroc.pl wrote:
> > Rick C <gnuarm.del...@gmail.com> wrote:
> > > On Thursday, January 12, 2023 at 10:28:21 PM UTC-4, anti...@math.uni.wroc.pl wrote:
> > > > Don Y <blocked...@foo.invalid> wrote:
> > > > > On 1/9/2023 4:23 PM, anti...@math.uni.wroc.pl wrote:
> > > > > > anti...@math.uni.wroc.pl wrote:
> > > > > >> I have bought few Blue Pills on Aliexpress. I expected to receive
> > > > > >> boards with some of known clones. But what I get does not look
> > > > > >> like any clone that I have heard of:
> > > > > >> - Cortex M4 with no FPU
> > > > > >> - 32k RAM
> > > > > >> - 128k flash
> > > > > >> - set of devices like STM32F103C8T6
> > > > > >>
> > > > > >> Chip seems to be resonable compatible, but I noticed notable
> > > > > >> difference in I2C peripherial: bit 14 in OAR1 (own address register 1)
> > > > > >> seem to be stuck at 1 (this is reserved bit which in original chips
> > > > > >> is 0). Peripherial address decoding seem to be partial, I can access
> > > > > >> registers at address incremented by 0x100, 0x200 or 0x300. Similarly,
> > > > > >> RAM shows in 128k range, incrementing address by 32k modifies the
> > > > > >> same memory.
> > > > > >>
> > > > > >> Most clones seem to use Cortex-M3. GD has GD32E103 with Cortex-M4,
> > > > > >> but GD docs claim extra features, apparently not present in this chip.
> > > > > >>
> > > > > >> Does anybody heard of/seen chip with features above?
> > > > > >
> > > > > > Info on internet mentions about 15 diffrenet Chinese manufacturers
> > > > > > cloning STM chips. One of them is Flashchip. My chip seem to
> > > > > > match id of FCM32F103C:
> > > > > >
> > > > > > (gdb) x/2xw 0x1FFFF7C0
> > > > > > 0x1ffff7c0: 0x46433332 0x0046103c
> > > > > >
> > > > > > which appears in FSM32F103C migration note. This is one of few
> > > > > > F103 compatible processors with M4 core, has 128kB flash. The
> > > > > > migration note claims 20 kB RAM, my test indicate 32kB. More
> > > > > > precisely, my test routine wrote to words from 0x20000400 to
> > > > > > 0x20008000 and checked that written value is there. This was
> > > > > > repeated for two different values. So I have rather strong
> > > > > > indication that chip really have 32kB RAM (ok, test only covered
> > > > > > 31kB, but first 1kB contained test program which apparently
> > > > > > run correctly). Maybe manufactures claim 20kB because this
> > > > > > is all what STM32F103CB has.
> > > > >
> > > > > Build a random number generator with a long, relatively prime period.
> > > > > Fill memory with successive values from that RNG. (The primeness
> > > > > ensures the pattern doesn't repeat at intervals that might be
> > > > > related to the addressing decoder)
> > > > >
> > > > > Reseed the RNG and run it, again -- this time checking values
> > > > > read from sequential locations against the computed random number.
> > > > > The first fault indicates an unexpected decoder error (i.e.,
> > > > > the address space "wrapping" at that value), a fault in the
> > > > > memory (I use this technique as a quick memory test) *or*
> > > > > the end of physical memory.
> > > > Long period is easy: I used a counter, actually 3 versions
> > > > of counter. One version of counter used large increment which
> > > > ensured that all bytes were changing quickly (with low increments
> > > > there were long streches were high bytes were the same).
> > > >
> > > > I also tried 3 lousy random number generators,
> > > > but in this problem I do not think that much more testing is
> > > > needed: AFAICS to pass my test with less memory chip would need
> > > > quite complicated address remapping working at bit level.
> > > > It does not make sense to put such circuit on the chip and
> > > > probably it is infeasible with chip technology.
> > > >
> > > > I double that lousy random number generators will be of
> > > > much use in future. But writing a good one is more work,
> > > > and even linking to some has disadvantage of size: memory
> > > > taken by test program was excluded from modification so
> > > > I wanted test program to be as small as possible. My program
> > > > was 680 bytes which together with varibles and stack comfortably
> > > > fit in 1kB of RAM...
> > >
> > > What's wrong with an LFSR? They are very simple and have relatively good pseudo-random properties. What, by your definition, is a "good" or a "lousy" RNG?
> > >
> > "lousy" RNG fails relatively simple statistic tests. That includes
> > LFSR in its usual incarnations. By chance, I have found paper
> > about random number generators which presents results of some
> > tests and proposes a different generator. There is related site:
> >
> > https://pcg-random.org
> >
> > I am not sure if this one is really good, but the material they
> > present shows weaknesses of many others.
>
> Maybe I didn't read the thread well enough, but I thought this was just a way to generate addresses to test RAM, no?
^^^^^^^^^
Rather values to store. Addresses are incremented in sequential way.

> The only specific property I've seen is that it be "relatively prime" to the memory address space. LFSR certainly can manage that. Heck, a Grey code can probably manage that.
>
> With 17 bits, I can generate a PR sequence that is relatively prime to powers of 2 and of length 82,677.
>
> Am I missing something important?

Don Y wrote that PRNG is generally usable for other problems. But
for simulations and Monte Carlo computations statistical properties
are important. Lousy PRNG-s are major source of erros in such
computations.

And yes, for memory testing good randomness is not needed. As I
explained in other posts for testing _presence_ of memory I think
that already relatively simple counter is good enough.

--
Waldek Hebisch

Re: Another STM32F103 clone?

<tq5hah$34npg$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1248&group=comp.arch.embedded#1248

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 00:04:48 -0700
Organization: A noiseless patient Spider
Lines: 255
Message-ID: <tq5hah$34npg$1@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<tq2ruu$2ld9q$1@dont-email.me> <tq5ce8$vfm$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 17 Jan 2023 07:04:50 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3362025d40248a51fac28bde56f28df2";
logging-data="3301168"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nIMGGq1yOQ4aYMnFuSScV"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:/xEeN+WsEEfx/4DfRU6+d3COFR0=
Content-Language: en-US
In-Reply-To: <tq5ce8$vfm$1@gioia.aioe.org>
 by: Don Y - Tue, 17 Jan 2023 07:04 UTC

On 1/16/2023 10:41 PM, antispam@math.uni.wroc.pl wrote:
> Don Y <blockedofcourse@foo.invalid> wrote:
>> On 1/12/2023 7:28 PM, antispam@math.uni.wroc.pl wrote:
>>>> Build a random number generator with a long, relatively prime period.
>>>> Fill memory with successive values from that RNG. (The primeness
>>>> ensures the pattern doesn't repeat at intervals that might be
>>>> related to the addressing decoder)
>>>>
>>>> Reseed the RNG and run it, again -- this time checking values
>>>> read from sequential locations against the computed random number.
>>>> The first fault indicates an unexpected decoder error (i.e.,
>>>> the address space "wrapping" at that value), a fault in the
>>>> memory (I use this technique as a quick memory test) *or*
>>>> the end of physical memory.
>>>
>>> Long period is easy:
>>
>> "Long" isn't the critical aspect. What you want is a period that is
>> "relatively prime" wrt the likely address decoding. So, a write of
>> "random value X" to location N can't appear at any LIKELY "bad decode"
>> or that address, elsehwere in the address space you are probing.
>
> I do not see "relatively prime" as really helpful. I mean:
> I would use only tiny part of period, so for purpose of memory
> testing it does not matter too much.

A period that fits neatly into powers of two will miss problems.

Loc Value
0 01
1 11
2 00
3 10
4 01
5 11
6 00
7 10

If the address bit that identifies 0-3 from 4-7 is broken,
you will never know.

By contrast:

Loc Value
0 01
1 11
2 00
3 01
4 11
5 00
6 01
7 11

The values that are returned by a "stuck address bit"
wouldn't agree with your *expectations* of those values.
Because the period "3" is relatively prime wrt the different
powers of two used in the addressing.

>>> I used a counter, actually 3 versions
>>> of counter. One version of counter used large increment which
>>> ensured that all bytes were changing quickly (with low increments
>>> there were long streches were high bytes were the same).
>>
>> A generic random number generator doesn't confine changes
>> to "local regions" of the value. E.g.,
>> 00000101
>> 00001010
>> 00010100
>> 00101001
>> 01010011
>> 10100110
>> The goal being that bits/bytes don't repeat "regularly"
>> and that every bit sees some activity, in any set of
>> consecutively generated values.
>
> Do you realize that popular PRNG-s are perfectly regular using
> relatively simple rules? Better play tricks so that is
> hard to detect this regularity. My first two counters
> had problem that low order bits were changing with small
> periods, third one counted modulo a prime. When viewed
> as numbers, once you knew the rule it was perfectly
> regular (and probably guessing the rule would be not

Counters are bad sources of "random numbers".

Note the 8 bit example immediately above. *You* can
predict the MSBs without knowing the generator polynomial.
(you can't predict the LSBs, though). But, the memory can't
"predict" any of this.

If the second time through, the RNG is seeded differently:
00110101
01101010
11010100
10101001
01010011
10100110
then each address "sees" a different pattern from the first
pass so if the first memory value was "stuck" at, e.g., "00000101",
this would appear on the second pass when you *expected* it
to be 00110101.

> that hard). At bit level carries and modulo meant
> that logic working on separate bits or small groups of
> bits would have trouble following/predicting the
> sequence.
>
>>> I also tried 3 lousy random number generators,
>>> but in this problem I do not think that much more testing is
>>> needed: AFAICS to pass my test with less memory chip would need
>>> quite complicated address remapping working at bit level.
>>
>> Quite possible. I was merely offering a tool that one can
>> fall back on in these sorts of problems. I use this to
>> size and grossly test memory at POST; some number of passes
>> of writes with LATER read-verifies to ensure data is
>> retained and there are no decode failures (e.g., caused
>> by passing the end of physical memory).
>>
>> I learned this trick from a friend from school, in the video
>> (arcade) game heyday -- you don't have a lot of resources
>> *or* time to do comprehensive tests. Yet, you have to have
>> a reasonable level of confidence that the game is working
>> properly (folks get mad if you accept their coins and
>> don't deliver the product/experience!)
>
> If I what I wrote sounded negative, let me say that I in
> general have doubts about efficiency of many tests. For
> example, I waited on PC-s doing POST. Yet, I saw failing
> POST maybe one or two times and IIRC errors were so gross
> that very simple and much faster test should catch them.
> OTOH I have seem machines which passed POST but failed more
> comprehensive memory test. And machines that in use exhibited
> what looked like memory errors but passed available tests
> (I "cured" few by underclocking them).

If you want to stress memory, then you play games with Vcc
and temperature -- as well as access *patterns* (e.g.,
checkerboard to maximize noise within the array, look for
read-disturb errors, etc.).

What you are looking to do, at POST, is to detect gross errors.
Or, *here*, to detect where the memory exists and doesn't
exist (to "size" it).

A deployed device doesn't have the luxury of being able to
comprehensively test itself or its components.

Do you know how many ECC errors are being thrown and corrected
in your PC? At what level would you lose confidence in the
memory's ability to retain data "correctly"?

[This ignoring the fact that modern processors use ECC internally
to correct *their* errors!]

> In software context I saw projects that religiously added
> tests to have "100% test coverage", yet those tests were
> too weak to catch major breakage. OTOH I also had
> situations were _new_ approach to testing allowed to
> identify and consequently fix several bugs.

If you want to test a MCU-related device, you are best
advised to purchase a library designed by the device's
manufacturer. *They* know the patterns that will reveal
the most information on the health of the device. These
are neither inexpensive nor universally available (as
there are so many different devices in production)

> One approach to testing which is reasonably effective
> is to first identify likely "failure modes" and invent
> tests that detects specific failure mode. In this case
> possible "failure mode" was some address scrambling
> scheme. In fact there is some kind of "scrambling",
> namely chip seem to use incomplete address decoding.
> Now, for scrambling at word level already simplest
> counter would detect it.

No, it wouldn't. With 8 bits in a tested unit, any
wrap that occurs modulo 256 will not see a fault in any
of the address lines that distinguish between addresses
0-255 vs 256-511 vs 512-767...

> That still leaves possiblity
> of scrambling at byte or bit level. In particular,
> only carries prevent periodicity with period 256 and
> limited number of un-aliased extra cells possibly
> could handle places where carries occur. Second test
> had much more carries, making this highly unlikely.
> In third counter no bit position was periodic and
> carries were in different places than second test.
> So scrambling scheme that passes all 3 counter
> test is getting more weird. Now, address decoding
> lies on performence critical path. MCU manufactur
> needs good reason to put extra logic there. Skipping
> gates and using incomplete decoding is cheap. I am
> not sure if there is good reason to add any scrambling
> beyond incomplete decoding. But certainly there is
> no reason to add several complicated scrambling circuits
> working differently on different byte (or bit) planes.
>
> Also, goal of my testing was to find out if extra memory
> is there. Once you accept that there is 32kB of memory
> natural question is why manufactures says that there is
> 20KB. One possible answer is that manufactures does not
> test extra memory. So one may further ask if extra
> memory works reliably. Answering this last question
> goes well beyond goal of my testing, it is much bigger
> project and to that matter even if it works reliably for
> me it does not prove that it will work reliably for
> other people.


Click here to read the complete article
Re: Another STM32F103 clone?

<tq5hkc$34npg$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1249&group=comp.arch.embedded#1249

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: blockedo...@foo.invalid (Don Y)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 00:10:02 -0700
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <tq5hkc$34npg$2@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
<tq4r09$1uu5$1@gioia.aioe.org>
<065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>
<tq5dou$1bcn$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 17 Jan 2023 07:10:04 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="3362025d40248a51fac28bde56f28df2";
logging-data="3301168"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19H42VPv3PDk70ShnZ4HKKd"
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:qNVSKrDjHMeG3MM09ZZaq2zHHVU=
Content-Language: en-US
In-Reply-To: <tq5dou$1bcn$1@gioia.aioe.org>
 by: Don Y - Tue, 17 Jan 2023 07:10 UTC

On 1/16/2023 11:04 PM, antispam@math.uni.wroc.pl wrote:
> Don Y wrote that PRNG is generally usable for other problems. But

No, I said:
"The RNG isn't a big piece of code. And, can be parameterized
to fit your future needs."
as in "testing different sized chunks of memory"

> for simulations and Monte Carlo computations statistical properties
> are important. Lousy PRNG-s are major source of erros in such
> computations.

You use a better RNG for them. D'uh. And, excite them with
different entropy sources so subsequent runs don't produce the
same values (THIS application WANTS subsequent runs to produce
the same sequence so you can use it to verify the 256000 *bits*
that you've stored without having to keep a COPY of those 256000
bits on hand!)

> And yes, for memory testing good randomness is not needed. As I
> explained in other posts for testing _presence_ of memory I think
> that already relatively simple counter is good enough.

And, as I pointed out, it isn't.

Re: Another STM32F103 clone?

<tq65f5$383jo$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1250&group=comp.arch.embedded#1250

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 13:48:37 +0100
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <tq65f5$383jo$2@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
<tq4r09$1uu5$1@gioia.aioe.org>
<065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 17 Jan 2023 12:48:37 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="b6e5dd50e7694e179bc30cc5dc7c759c";
logging-data="3411576"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Ve+ySF2nHEhWGK7fKu0+OAr0pEzcxzJM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:fofQVzz+nb6TdW/SKd4+m8E2Stc=
Content-Language: en-GB
In-Reply-To: <065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>
 by: David Brown - Tue, 17 Jan 2023 12:48 UTC

On 17/01/2023 06:07, Rick C wrote:

> Maybe I didn't read the thread well enough, but I thought this was
> just a way to generate addresses to test RAM, no? The only specific
> property I've seen is that it be "relatively prime" to the memory
> address space. LFSR certainly can manage that. Heck, a Grey code
> can probably manage that.
>
> With 17 bits, I can generate a PR sequence that is relatively prime
> to powers of 2 and of length 82,677.
>
> Am I missing something important?
>

Not really, no. Well, there's the detail that the sequence must be wide
enough so that it does not repeat during the testing. A sequence with
length 82,677 will be fine for 128 kB flash (two bytes per element), but
is not scalable to a 256 kB flash test.

But while LFSR's are nice in some use-cases, they are not the simplest
sequence generator for software for this sort of thing.

One of the best is:

const uint32_t a = 984830993;
const uint32_t b = 1267261529;

uint32_t pseudo(uint32_t i) {
return (a * i) + b;
}

"a" and "b" are just big prime numbers, as found from this link or by
googling around a bit:

<http://compoasso.free.fr/primelistweb/page/prime/liste_online_en.php>

This gives you a sequence that is deterministic, you can jump into it at
any point, it has no correlation with bit numbers, addresses, etc., and
is extremely simple to calculate.

Re: Another STM32F103 clone?

<tq6kh9$1iaf$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1253&group=comp.arch.embedded#1253

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 17:05:45 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tq6kh9$1iaf$1@gioia.aioe.org>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org> <tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org> <eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com> <tq4r09$1uu5$1@gioia.aioe.org> <065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com> <tq65f5$383jo$2@dont-email.me>
Injection-Info: gioia.aioe.org; logging-data="51535"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
Cancel-Lock: sha1:aZaKYB96SION3FTCfm2ZduAtDME=
X-Notice: Filtered by postfilter v. 0.9.2
 by: antis...@math.uni.wroc.pl - Tue, 17 Jan 2023 17:05 UTC

David Brown <david.brown@hesbynett.no> wrote:
> On 17/01/2023 06:07, Rick C wrote:
>
> > Maybe I didn't read the thread well enough, but I thought this was
> > just a way to generate addresses to test RAM, no? The only specific
> > property I've seen is that it be "relatively prime" to the memory
> > address space. LFSR certainly can manage that. Heck, a Grey code
> > can probably manage that.
> >
> > With 17 bits, I can generate a PR sequence that is relatively prime
> > to powers of 2 and of length 82,677.
> >
> > Am I missing something important?
> >
>
> Not really, no. Well, there's the detail that the sequence must be wide
> enough so that it does not repeat during the testing. A sequence with
> length 82,677 will be fine for 128 kB flash (two bytes per element), but
> is not scalable to a 256 kB flash test.
>
> But while LFSR's are nice in some use-cases, they are not the simplest
> sequence generator for software for this sort of thing.
>
> One of the best is:
>
> const uint32_t a = 984830993;
> const uint32_t b = 1267261529;
>
> uint32_t pseudo(uint32_t i) {
> return (a * i) + b;
> }
>
> "a" and "b" are just big prime numbers, as found from this link or by
> googling around a bit:
>
> <http://compoasso.free.fr/primelistweb/page/prime/liste_online_en.php>
>
>
> This gives you a sequence that is deterministic, you can jump into it at
> any point, it has no correlation with bit numbers, addresses, etc., and
> is extremely simple to calculate.

That is more or less one of lousy generators that I used (I had
different constants). For memory testing it shares the same
problems that counters have: low order bits have short period
that is power of 2. When you want good randomness, they fail
relatively simple statistical tests. One can improve them
or they may be good enough for some applications, but one
should be aware of their limitations.

--
Waldek Hebisch

Re: Another STM32F103 clone?

<tq6q62$3bfkt$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1254&group=comp.arch.embedded#1254

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 19:42:10 +0100
Organization: A noiseless patient Spider
Lines: 68
Message-ID: <tq6q62$3bfkt$1@dont-email.me>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
<tq4r09$1uu5$1@gioia.aioe.org>
<065743c2-fcd8-4952-ac25-39c657d348d8n@googlegroups.com>
<tq65f5$383jo$2@dont-email.me> <tq6kh9$1iaf$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 17 Jan 2023 18:42:10 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="38226a96846ad124cabe4d431cca06f6";
logging-data="3522205"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g/oI8oC3wQahPU/3vcbEcEGEoUR3gLeM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:8PE3jk2UYXlrGtNIim6Ph/FBPsY=
Content-Language: en-GB
In-Reply-To: <tq6kh9$1iaf$1@gioia.aioe.org>
 by: David Brown - Tue, 17 Jan 2023 18:42 UTC

On 17/01/2023 18:05, antispam@math.uni.wroc.pl wrote:
> David Brown <david.brown@hesbynett.no> wrote:
>> On 17/01/2023 06:07, Rick C wrote:
>>
>>> Maybe I didn't read the thread well enough, but I thought this was
>>> just a way to generate addresses to test RAM, no? The only specific
>>> property I've seen is that it be "relatively prime" to the memory
>>> address space. LFSR certainly can manage that. Heck, a Grey code
>>> can probably manage that.
>>>
>>> With 17 bits, I can generate a PR sequence that is relatively prime
>>> to powers of 2 and of length 82,677.
>>>
>>> Am I missing something important?
>>>
>>
>> Not really, no. Well, there's the detail that the sequence must be wide
>> enough so that it does not repeat during the testing. A sequence with
>> length 82,677 will be fine for 128 kB flash (two bytes per element), but
>> is not scalable to a 256 kB flash test.
>>
>> But while LFSR's are nice in some use-cases, they are not the simplest
>> sequence generator for software for this sort of thing.
>>
>> One of the best is:
>>
>> const uint32_t a = 984830993;
>> const uint32_t b = 1267261529;
>>
>> uint32_t pseudo(uint32_t i) {
>> return (a * i) + b;
>> }
>>
>> "a" and "b" are just big prime numbers, as found from this link or by
>> googling around a bit:
>>
>> <http://compoasso.free.fr/primelistweb/page/prime/liste_online_en.php>
>>
>>
>> This gives you a sequence that is deterministic, you can jump into it at
>> any point, it has no correlation with bit numbers, addresses, etc., and
>> is extremely simple to calculate.
>
> That is more or less one of lousy generators that I used (I had
> different constants). For memory testing it shares the same
> problems that counters have: low order bits have short period
> that is power of 2. When you want good randomness, they fail
> relatively simple statistical tests. One can improve them
> or they may be good enough for some applications, but one
> should be aware of their limitations.
>

It is not supposed to pass any statistical tests for randomness - all
you need here is no simple correlation between the values you write and
the address. It is not a serious pseudo random generator, just a simple
deterministic sequence that jumps around enough for the job, with
insignificant costs in terms of source code and run time.

If you want to remove the power-of-two cycles of the bits (for example,
if you want to do memory testing and check there is no short-circuit
between address lines and data lines), include a modulo operation by
another large prime number.

Re: Another STM32F103 clone?

<87o7qxugig.fsf@nightsong.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=1255&group=comp.arch.embedded#1255

  copy link   Newsgroups: comp.arch.embedded
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.arch.embedded
Subject: Re: Another STM32F103 clone?
Date: Tue, 17 Jan 2023 11:07:19 -0800
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <87o7qxugig.fsf@nightsong.com>
References: <tpddc3$1565$1@gioia.aioe.org> <tpi7l4$qe3$1@gioia.aioe.org>
<tpic2h$b04f$1@dont-email.me> <tpqfk0$77v$1@gioia.aioe.org>
<eb5789da-2f3b-45a8-ae0d-f8fe8c8c4c1bn@googlegroups.com>
<tq4r09$1uu5$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="ad4fe274bbaaf22360b211a2181d0484";
logging-data="3533190"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fq+f5NHz6JUd1jJgGG2ga"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:0elDmwZsTd/Xkj6iojHUwvkOHK8=
sha1:0UacocZqKyE3wWPivOM0tjZ11TQ=
 by: Paul Rubin - Tue, 17 Jan 2023 19:07 UTC

antispam@math.uni.wroc.pl writes:
> "lousy" RNG fails relatively simple statistic tests.

For a memory tester, the RNG only has to scatter the address sequence
enough to decorrelate it from whatever address interactions might lurk
within the hardware.

Of course, for some kinds of issues like Rowhammer, finding the
interactions is also important.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor