Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix missing ROM partition type #237

Merged
merged 1 commit into from
Jun 30, 2017
Merged

Conversation

kolipka
Copy link
Contributor

@kolipka kolipka commented Jun 28, 2017

With this fix ROM partition will be handled.
To test it:

  1. In os/.config add line:
    CONFIG_FS_ROMFS=y
  2. Adjust partitions, eg:
CONFIG_ARTIK053_FLASH_PART_LIST="16,48,192,32,512,2400,1536,1536,1000,400,8,512,"
CONFIG_ARTIK053_FLASH_PART_TYPE="none,ftl,none,none,none,none,none,ftl,smartfs,romfs,config,none,"
CONFIG_ARTIK053_FLASH_PART_NAME="bl1,sssro,bl2,sssfw,wlanfw,os,factory,ota,user,rom,nvram,sssrw,"

above lines change size of main user partition from 1400 * 1KB to 1000 * 1KB
and add new 400 * 1KB partition. Type is romfs.
3. call make to build image
4. prepare ROM image using genromfs
genromfs -f bin/rom.img -d /path/to/rom_fs/folder -V "NuttXBootVol"
5. in openocd/partition_map.cfg add line corresponding with point 2

user	{ "USER R/W"		0x04620000	0x000FA000  0 }
rom  	{ "ROM FS"  		0x0471A000	0x00064000  0 }
  1. flash os & rom
flash_write os     ../bin/tinyara_head.bin;       \
flash_write rom    ../bin/rom.img;       \
  1. mount on device
    mount -t romfs /dev/smart4rom9 /rom

With this addition ROM partition will be enabled.
To test it:
1. In os/.config add line:
  CONFIG_FS_ROMFS=y
2. Adjust partitions, eg:
  CONFIG_ARTIK053_FLASH_PART_LIST="16,48,192,32,512,2400,1536,1536,1000,400,8,512,"
  CONFIG_ARTIK053_FLASH_PART_TYPE="none,ftl,none,none,none,none,none,ftl,smartfs,romfs,config,none,"
  CONFIG_ARTIK053_FLASH_PART_NAME="bl1,sssro,bl2,sssfw,wlanfw,os,factory,ota,user,rom,nvram,sssrw,"
above lines change size of main user partition from 1400*1KB to 1000*1KB
and add new 400*1KB partition. Type is romfs.
3. call make to build image
4. prepare ROM image using genromfs
  genromfs -f bin/rom.img -d /path/to/rom_fs/folder -V "NuttXBootVol"
5. in openocd/partition_map.cfg add line corresponding with point 2
  user	{ "USER R/W"		0x04620000	0x000FA000  0 }
  rom  	{ "ROM FS"  		0x0471A000	0x00064000  0 }
6. flash os & rom
  flash_write os     ../bin/tinyara_head.bin;       \
  flash_write rom    ../bin/rom.img;       \
7. mount on device
  mount -t romfs /dev/smart4rom9 /rom
@sunghan-chang
Copy link
Contributor

@JunhwanPark Please review this P.R.

@heesub
Copy link
Contributor

heesub commented Jun 30, 2017

OK, this commit initializes an MTD partition of which type is 'romfs' at boot. so that it can be accessed through /dev/smartXromY. It does not affect others unless they modifies their configuration. Looks quite relevant and good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants