Skip to content

Commit dc241b2

Browse files
committed
First cut at MS51FB9AE chip addition
1 parent 12b9a91 commit dc241b2

File tree

5 files changed

+75
-5
lines changed

5 files changed

+75
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
nuvoprog
2+
nuvoprog-dev
3+
zzz-*
24
*.ihx

cmd/root.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,33 @@ var targetName string
3333
// rootCmd represents the base command when called without any subcommands
3434
var rootCmd = &cobra.Command{
3535
Use: "nuvoprog",
36-
Short: "Nuvoton device programmer",
36+
Short: "Nuvoton device programmer ** experimental MS51FB upgraded version **",
3737
Long: `A tool for programming Nuvoton devices, particularly
38-
focusing on their modern 8051 family`,
38+
focusing on their modern 8051 family ** experimental MS51FB upgraded version **
39+
40+
Notes:
41+
Possible targets are Novoton N76E003 and MS51FB9AE. The programmer utility has been tested with MyLink on a 8051 NuTiny dev board.
42+
43+
The Program memory is limited to 12KB for both the N76E003 and MS51FB9AE processors because the image split command does not
44+
parse the chip configuration to determine the split between the program flash and load flash memory,
45+
So it defaults to the worst case of 4KB of load flash. (The N76E003 might be able to be upped to 14KB, but it was set to
46+
12KB by original author).
47+
48+
If you are going to rebuild this program:
49+
The include paths are setup as relative, so this program source code should be copied to your system
50+
(git clone of zip file - https://github.com/mountaintom/nuvoprog.git - at this time this modified version in in one of the branches) and
51+
compiled (go build) in-place on your computer. The nuvoprog command run from there or manually moved to where you want it.
52+
53+
You can compile the nuvoprog utility as another name (such as nuvoprog-test) by changing the main directory name (such as nuvoprog to nuvoprog-test) then run go build.
54+
55+
Examples:
56+
Download flash data from chip:
57+
./nuvoprog read ./flash-read.ihx --target MS51FB9AE
58+
59+
Split downloaded flash data into Program, Load ROM and chip configuration files:
60+
./nuvoprog image split -i ./flash-read.ihx --target MS51FB9AE -a program-flash-data.ihx -l loader-flas-data.ihx -c chip-configuration.json
61+
Note: This is how to get an example chip-config json to work with file.
62+
`,
3963
PersistentPreRun: func(cmd *cobra.Command, args []string) {
4064
if !verbose {
4165
log.SetOutput(ioutil.Discard)

protocol/commands.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,16 @@ const (
296296
// 0x00CCDDDD where
297297
// CC = Company ID
298298
// DDDD = Device ID
299-
//DeviceN76E003 = 0xDA3650
300-
DeviceN76E003 = 0x00da4b21
299+
DeviceN76E003 = 0xDA3650
300+
DeviceMS51FB9AE = 0x00da4b21
301301
)
302302

303303
func (id DeviceID) String() string {
304304
switch id {
305305
case DeviceN76E003:
306306
return "N76E003"
307+
case DeviceMS51FB9AE:
308+
return "MS51FB9AE"
307309
default:
308310
return fmt.Sprintf("0x%08x", uint32(id))
309311
}

target/n76/ms51fb9ae.go

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright © 2019 Erin Shepherd
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
package n76
15+
16+
import (
17+
// "errors"
18+
19+
//"github.com/erincandescent/nuvoprog/protocol"
20+
//"github.com/erincandescent/nuvoprog/target"
21+
"../../protocol"
22+
"../..//target"
23+
)
24+
25+
var MS51FB9AE = &target.Definition{
26+
Name: "MS51FB9AE",
27+
Family: protocol.ChipFamilyN76E003,
28+
DeviceID: protocol.DeviceMS51FB9AE,
29+
ProgMemSize: 12 * 1024,
30+
LDROMOffset: 0x3000,
31+
Config: target.ConfigSpace{
32+
IHexOffset: 0x30000,
33+
MinSize: 4,
34+
ReadSize: 8,
35+
WriteSize: 32,
36+
NewConfig: func() target.Config { return new(N76E003Config) },
37+
},
38+
}
39+
40+
func init() {
41+
target.Register(MS51FB9AE)
42+
}

target/n76/n76e003.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
//"github.com/erincandescent/nuvoprog/protocol"
2020
//"github.com/erincandescent/nuvoprog/target"
2121
"../../protocol"
22-
"../..//target"
22+
"../../target"
2323
)
2424

2525
//go:generate enumer -type=BootSelect -trimprefix=BootFrom -transform=snake -json -text

0 commit comments

Comments
 (0)