CC3200 with 16mb flash

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
Post Reply
sekil
Posts: 7
Joined: Wed Mar 25, 2020 12:04 pm

CC3200 with 16mb flash

Post by sekil » Thu Apr 02, 2020 3:09 pm

Hi.

I'm change stock 1mb flash to 16mb - formated in uniflash with 16mb option - install micropython - all working..
i'm try change MICROPY_PORT_SFLASH_BLOCK_COUNT - large than 32 or 96 - try 128, 192, 160 - with all this board cant start - only working with 32 or 96 - why? where problem?

User avatar
jimmo
Posts: 2015
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: CC3200 with 16mb flash

Post by jimmo » Fri Apr 03, 2020 12:47 am

Hi,

I'm not sure how much usage the CC3200 port gets these days (just based on how much it's discussed in this forum) so not sure how easy it'll be to get answers.

Unfortunately I don't have a CC3200 board or any real experience with this chip, but I took a look at the code, and here are some hints about where to look:
- Perhaps there's a specific layout of how the firmware goes into the flash, and something else is assuming an offset equivalent to ~96 blocks), which now means the filesystem is now overwriting the firmware?
- The way the filesystem works on the CC3200 is that it makes a virtual block device based on the simple filesystem provided by the TI drivers (these are the .fsb files, each of which are 2048 bytes -- see https://github.com/micropython/micropython/issues/5736 -- this is SFLASH_BLOCK_SIZE). If you read the code for the driver, (drivers/cc3100/inc/fs.h) there's a mention of "granularity" which maps to max filesystem size. Interestingly when you do the maths, I think it works out that 128 blocks would be the threshold where it now needs to use 4kiB blocks. Either way, I think understanding what's going on here is probably key to figuring this out.

So as a qucik experiment, try changing SFLASH_BLOCK_SIZE (in ports/cc3200/fatfs/src/drivers/sflash_diskio.h) to 4096 (and keep MICROPY_PORT_SFLASH_BLOCK_COUNT set to 96). Hopefully this doesn't cause it to need too much RAM, but you'll double the size of the filesystem (and then you can experiment from there).

sekil
Posts: 7
Joined: Wed Mar 25, 2020 12:04 pm

Re: CC3200 with 16mb flash

Post by sekil » Fri Apr 03, 2020 6:38 am

No this not helping - board not booting..

I'm try research - if i'm increase block counts - fw try makes files in internal fs - and after index of file == 127 - board freezes, i'm think because this is limit to number of files in internal fs:

from uniflash:

Code: Select all

[10:20:45] INFO: 	121	257	1	no	1		blk103
[10:20:45] INFO: 	122	258	1	no	1		blk104
[10:20:45] INFO: 	123	259	1	no	1		blk105
[10:20:45] INFO: 	124	260	1	no	1		blk106
[10:20:45] INFO: 	125	261	1	no	1		blk107
[10:20:45] INFO: 	126	262	1	no	1		blk108
[10:20:45] INFO: 	127	263	1	no	1		blk109
p.s. i'm change files names in my fw...

If i'm change block size to 4096 - i'm see this:

Code: Select all

[10:19:16] INFO: 	16	151	1	yes	2		/sys/date_time.cfg
[10:19:16] INFO: 	17	153	2	no	2		blk0
This mean that board freezes after make first file - sflash_disk_init - returns error and fw freeze..
But why this? sl_fsopen - returned errors - not creating new files after if index > 127...

sekil
Posts: 7
Joined: Wed Mar 25, 2020 12:04 pm

Re: CC3200 with 16mb flash

Post by sekil » Fri Apr 03, 2020 8:32 am

Yes - this is limit number of files in internal fs - if in flash number of files == 128 - uniflash cant write any new files to flash!

Code: Select all

[12:34:10] INFO: 	file	start	size	fail	total size	filename
[12:34:10] INFO: 	index	block	[BLKs]	safe	[BLKs]
[12:34:10] INFO: ----------------------------------------------------------------------------
[12:34:10] INFO: 	N/A	0	5	N/A	5		FATFS
[12:34:10] INFO: 	0	81	8	yes	16		/sys/mcuimg.bin
[12:34:10] INFO: 	4	5	5	yes	10		/tmp/phy.cal
[12:34:10] INFO: 	6	15	33	yes	66		/sys/servicepack.ucf
[12:34:10] INFO: 	7	97	1	yes	2		/sys/stacfg.ini
[12:34:10] INFO: 	8	99	1	no	1		__000__.fsb
[12:34:10] INFO: 	9	100	1	no	1		__001__.fsb
[12:34:10] INFO: 	10	101	1	no	1		__002__.fsb
[12:34:10] INFO: 	11	102	1	no	1		__003__.fsb
[12:34:10] INFO: 	12	103	1	no	1		__004__.fsb
[12:34:10] INFO: 	13	104	1	no	1		__005__.fsb
[12:34:10] INFO: 	14	105	1	no	1		__006__.fsb
[12:34:10] INFO: 	15	106	1	no	1		__007__.fsb
[12:34:10] INFO: 	16	107	1	no	1		__008__.fsb
[12:34:10] INFO: 	17	108	1	no	1		__009__.fsb
[12:34:10] INFO: 	18	109	1	no	1		__010__.fsb
[12:34:10] INFO: 	19	110	1	no	1		__011__.fsb
[12:34:10] INFO: 	20	111	1	no	1		__012__.fsb
[12:34:10] INFO: 	21	112	1	no	1		__013__.fsb
[12:34:10] INFO: 	22	113	1	no	1		__014__.fsb
[12:34:10] INFO: 	23	114	1	no	1		__015__.fsb
[12:34:10] INFO: 	24	115	1	no	1		__016__.fsb
[12:34:10] INFO: 	26	116	1	no	1		__017__.fsb
[12:34:10] INFO: 	27	117	1	no	1		__018__.fsb
[12:34:10] INFO: 	28	118	1	no	1		__019__.fsb
[12:34:10] INFO: 	29	119	1	no	1		__020__.fsb
[12:34:10] INFO: 	30	120	1	no	1		__021__.fsb
[12:34:10] INFO: 	31	121	1	no	1		__022__.fsb
[12:34:10] INFO: 	32	122	1	no	1		__023__.fsb
[12:34:10] INFO: 	33	123	1	no	1		__024__.fsb
[12:34:10] INFO: 	34	124	1	no	1		__025__.fsb
[12:34:10] INFO: 	35	125	1	no	1		__026__.fsb
[12:34:10] INFO: 	36	126	1	no	1		__027__.fsb
[12:34:10] INFO: 	37	127	1	no	1		__028__.fsb
[12:34:10] INFO: 	38	128	1	no	1		__029__.fsb
[12:34:10] INFO: 	39	129	1	no	1		__030__.fsb
[12:34:10] INFO: 	40	130	1	no	1		__031__.fsb
[12:34:10] INFO: 	41	131	1	no	1		__032__.fsb
[12:34:10] INFO: 	42	132	1	no	1		__033__.fsb
[12:34:10] INFO: 	43	133	1	no	1		__034__.fsb
[12:34:10] INFO: 	44	134	1	no	1		__035__.fsb
[12:34:10] INFO: 	45	135	1	no	1		__036__.fsb
[12:34:10] INFO: 	46	136	1	no	1		__037__.fsb
[12:34:10] INFO: 	47	137	1	no	1		__038__.fsb
[12:34:10] INFO: 	48	138	1	no	1		__039__.fsb
[12:34:10] INFO: 	49	139	1	no	1		__040__.fsb
[12:34:10] INFO: 	50	140	1	no	1		__041__.fsb
[12:34:10] INFO: 	51	141	1	no	1		__042__.fsb
[12:34:10] INFO: 	52	142	1	no	1		__043__.fsb
[12:34:10] INFO: 	53	143	1	no	1		__044__.fsb
[12:34:10] INFO: 	54	144	1	no	1		__045__.fsb
[12:34:10] INFO: 	55	145	1	no	1		__046__.fsb
[12:34:10] INFO: 	56	146	1	no	1		__047__.fsb
[12:34:10] INFO: 	57	147	1	no	1		__048__.fsb
[12:34:10] INFO: 	58	148	1	no	1		__049__.fsb
[12:34:10] INFO: 	59	149	1	no	1		__050__.fsb
[12:34:10] INFO: 	60	150	1	no	1		__051__.fsb
[12:34:10] INFO: 	61	151	1	no	1		__052__.fsb
[12:34:10] INFO: 	62	152	1	no	1		__053__.fsb
[12:34:10] INFO: 	63	153	1	no	1		__054__.fsb
[12:34:10] INFO: 	64	154	1	no	1		__055__.fsb
[12:34:10] INFO: 	65	155	1	no	1		__056__.fsb
[12:34:10] INFO: 	66	156	1	no	1		__057__.fsb
[12:34:10] INFO: 	67	157	1	no	1		__058__.fsb
[12:34:10] INFO: 	68	158	1	no	1		__059__.fsb
[12:34:10] INFO: 	69	159	1	no	1		__060__.fsb
[12:34:10] INFO: 	70	160	1	no	1		__061__.fsb
[12:34:10] INFO: 	71	161	1	no	1		__062__.fsb
[12:34:10] INFO: 	72	162	1	no	1		__063__.fsb
[12:34:10] INFO: 	73	163	1	no	1		__064__.fsb
[12:34:10] INFO: 	74	164	1	no	1		__065__.fsb
[12:34:10] INFO: 	75	165	1	no	1		__066__.fsb
[12:34:10] INFO: 	76	166	1	no	1		__067__.fsb
[12:34:10] INFO: 	77	167	1	no	1		__068__.fsb
[12:34:10] INFO: 	78	168	1	no	1		__069__.fsb
[12:34:10] INFO: 	79	169	1	no	1		__070__.fsb
[12:34:10] INFO: 	80	170	1	no	1		__071__.fsb
[12:34:10] INFO: 	81	171	1	no	1		__072__.fsb
[12:34:10] INFO: 	82	172	1	no	1		__073__.fsb
[12:34:10] INFO: 	83	173	1	no	1		__074__.fsb
[12:34:10] INFO: 	84	174	1	no	1		__075__.fsb
[12:34:10] INFO: 	85	175	1	no	1		__076__.fsb
[12:34:10] INFO: 	86	176	1	no	1		__077__.fsb
[12:34:10] INFO: 	87	177	1	no	1		__078__.fsb
[12:34:10] INFO: 	88	178	1	no	1		__079__.fsb
[12:34:10] INFO: 	89	179	1	no	1		__080__.fsb
[12:34:10] INFO: 	90	180	1	no	1		__081__.fsb
[12:34:10] INFO: 	91	181	1	no	1		__082__.fsb
[12:34:10] INFO: 	92	182	1	no	1		__083__.fsb
[12:34:10] INFO: 	93	183	1	no	1		__084__.fsb
[12:34:10] INFO: 	94	184	1	no	1		__085__.fsb
[12:34:10] INFO: 	95	185	1	no	1		__086__.fsb
[12:34:10] INFO: 	96	186	1	no	1		__087__.fsb
[12:34:10] INFO: 	97	187	1	no	1		__088__.fsb
[12:34:10] INFO: 	98	188	1	no	1		__089__.fsb
[12:34:10] INFO: 	99	189	1	no	1		__090__.fsb
[12:34:10] INFO: 	100	190	1	no	1		__091__.fsb
[12:34:10] INFO: 	101	191	1	no	1		__092__.fsb
[12:34:10] INFO: 	102	192	1	no	1		__093__.fsb
[12:34:10] INFO: 	103	193	1	no	1		__094__.fsb
[12:34:10] INFO: 	104	194	1	no	1		__095__.fsb
[12:34:10] INFO: 	105	195	1	no	1		__096__.fsb
[12:34:10] INFO: 	106	196	1	no	1		__097__.fsb
[12:34:10] INFO: 	107	197	1	no	1		__098__.fsb
[12:34:10] INFO: 	108	198	1	no	1		__099__.fsb
[12:34:10] INFO: 	109	199	1	no	1		__100__.fsb
[12:34:10] INFO: 	110	200	1	no	1		__101__.fsb
[12:34:10] INFO: 	111	201	1	no	1		__102__.fsb
[12:34:10] INFO: 	112	202	1	no	1		__103__.fsb
[12:34:10] INFO: 	113	203	1	no	1		__104__.fsb
[12:34:10] INFO: 	114	204	1	no	1		__105__.fsb
[12:34:10] INFO: 	115	205	1	no	1		__106__.fsb
[12:34:10] INFO: 	116	206	1	no	1		__107__.fsb
[12:34:10] INFO: 	117	207	1	no	1		__108__.fsb
[12:34:10] INFO: 	118	208	1	no	1		__109__.fsb
[12:34:10] INFO: 	119	209	1	no	1		__110__.fsb
[12:34:10] INFO: 	120	210	1	no	1		__111__.fsb
[12:34:10] INFO: 	121	211	1	no	1		__112__.fsb
[12:34:10] INFO: 	122	212	1	no	1		__113__.fsb
[12:34:10] INFO: 	123	213	1	no	1		__114__.fsb
[12:34:10] INFO: 	124	214	1	no	1		__115__.fsb
[12:34:10] INFO: 	125	215	1	no	1		__116__.fsb
[12:34:10] INFO: 	126	216	1	no	1		__117__.fsb
[12:34:10] INFO: 	127	217	1	no	1		__118__.fsb


[12:34:10] INFO: 	Flash usage
[12:34:10] INFO: -------------------------
[12:34:10] INFO: used space:	218 blocks
[12:34:10] INFO: free space:	3878 blocks
[12:34:10] INFO: memory hole:	[218-4095]

Code: Select all

[12:31:18] INFO: erasing file "/sys/test1"
[12:31:18] INFO: deleting file "/sys/test1"
[12:31:18] INFO: erase file completed
[12:31:18] INFO: > Size of file = 2448
[12:31:18] INFO: > Update File: /sys/test1
[12:31:18] INFO: Downloading file "/sys/test1" with size 2448
[12:31:18] ERROR: Open operation failed

And i'm think cc3200 port have some bugs - if i'm change block size bigger than 2048 - board not starting but creating all files..
Need rewrite many stuff in cc3200 port

P.S. cc3200 bad mcu :lol: many many limitations

Post Reply