Skip to content

Commit 2c2dba0

Browse files
Fan LinFan Lin
authored andcommitted
Guide for handling "module not found" issue. And add support for tested modules.
1 parent f5aec72 commit 2c2dba0

8 files changed

Lines changed: 90 additions & 4 deletions

File tree

documentation/devices/linemb.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Notice this is only tested with Ubuntu 22.04 for the host machine.
88
Key steps:
99
```bash
1010
sudo
11-
export MODDABLE=/workspaces/linfan/moddable
11+
export MODDABLE=[your moddalbe root folder]
1212
export PATH=$PATH:$MODDABLE/build/bin/lin/release
1313
cd $MODDABLE/build/makefiles/lin
1414
make
@@ -46,7 +46,8 @@ mcconfig -d -m -p linemb/x86_64
4646
The generated executable can be found at:
4747
`$MODDABLE/build/bin/linemb/x86_64/debug/helloworld/helloworld`
4848

49-
## ARM(32-bit) example
49+
## Running on ARM devices
50+
### ARM(32-bit)
5051
```bash
5152
cd $MODDABLE/examples/helloworld
5253
mcconfig -d -m -p linemb/armhf
@@ -55,7 +56,7 @@ mcconfig -d -m -p linemb/armhf
5556
The generated executable can be found at:
5657
`$MODDABLE/build/bin/linemb/armhf/debug/helloworld/helloworld`
5758

58-
## ARM(64-bit) example
59+
### ARM(64-bit)
5960
```bash
6061
cd $MODDABLE/examples/helloworld
6162
mcconfig -d -m -p linemb/arm64
@@ -64,6 +65,7 @@ mcconfig -d -m -p linemb/arm64
6465
The generated executable can be found at:
6566
`$MODDABLE/build/bin/linemb/arm64/debug/helloworld/helloworld`
6667

68+
### Copy to device
6769
Find a way to copy this file to the target board (e.g., using scp):
6870

6971
```bash
@@ -78,6 +80,50 @@ Hello, world - sample
7880
instruments: 248,32768,2432,65504,1344,12288,0,2,1,0,0,0
7981
instruments: 248,32768,2432,65504,416,12288,0,2,1,0,0,0
8082
instruments: 248,32768,2432,65504,416,12288,0,2,1,0,0,0
83+
```
84+
85+
# Fix "module unsupported" issue
86+
87+
If you encounter an error like "XXX module unsupported" when using the linemb platform, it's because the module's `manifest.json` file doesn't specify a C language implementation for the linemb platform.
88+
89+
The simplest solution is to copy the implementation from the "lin" platform. Follow these steps:
90+
91+
1. Open the module's `manifest.json` file (e.g., `modules/files/file/manifest.json` for file module)
92+
2. Ensure the linemb platform configuration includes the module implementation, for example:
93+
94+
```json
95+
"linemb": {
96+
"modules": {
97+
"*": "$(MODULES)/files/file/lin/*"
98+
},
99+
"config": {
100+
"file": {
101+
"root": "/tmp/"
102+
}
103+
}
104+
}
105+
```
106+
107+
Please note that many modules for the `lin` platform (especially hardware-related ones) have not been thoroughly tested. It's recommended to enable modules according to your specific needs and perform adequate testing to ensure proper functionality.
108+
109+
If you encounter issues with the `lin` platform implementation, a better approach is to create a linemb-specific implementation:
110+
111+
1. Create a new folder for the linemb platform implementation (e.g., `modules/files/file/linemb/`)
112+
2. Implement the necessary C files specifically for the linemb platform
113+
3. Update the manifest.json to use this implementation:
114+
115+
```json
116+
"linemb": {
117+
"modules": {
118+
"*": "$(MODULES)/files/file/linemb/*"
119+
},
120+
"config": {
121+
"file": {
122+
"root": "/tmp/"
123+
}
124+
}
125+
}
126+
```
81127

128+
This approach allows you to create optimized implementations tailored to the linemb platform.
82129

83-
```

examples/manifest_net.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
},
4848
"mac": {},
4949
"lin": {},
50+
"linemb": {},
5051
"win": {},
5152
"...": {
5253
"error": "manifest_net - unsupported platform"

modules/files/file/manifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@
6969
}
7070
}
7171
},
72+
"linemb": {
73+
"modules": {
74+
"*": "$(MODULES)/files/file/lin/*"
75+
},
76+
"config": {
77+
"file": {
78+
"root": "/tmp/"
79+
}
80+
}
81+
},
7282
"qca4020": {
7383
"modules": {
7484
"*": "$(MODULES)/files/file/qca4020/*"

modules/io/manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"lin": {
2727
"include": "./manifests/lin/manifest.json"
2828
},
29+
"linemb": {
30+
"include": "./manifests/lin/manifest.json"
31+
},
2932
"win": {
3033
"include": "./manifests/win/manifest.json"
3134
}

modules/network/ethernet/manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
"lin": {
2626
"include": "$(MODULES)/network/wifi/manifest.json"
2727
},
28+
"linemb": {
29+
"include": "$(MODULES)/network/wifi/manifest.json"
30+
},
2831
"mac": {
2932
"include": "$(MODULES)/network/wifi/manifest.json"
3033
},

modules/network/net/manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
]
4646
}
4747
},
48+
"linemb": {
49+
"modules": {
50+
"*": [
51+
"$(MODULES)/network/net/net",
52+
"$(MODULES)/network/net/lin/*"
53+
]
54+
}
55+
},
4856
"mac": {
4957
"modules": {
5058
"*": [

modules/network/socket/manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
]
4141
}
4242
},
43+
"linemb": {
44+
"modules": {
45+
"*": [
46+
"$(MODULES)/network/socket/*",
47+
"$(MODULES)/network/socket/lin/*"
48+
]
49+
}
50+
},
4351
"mac": {
4452
"modules": {
4553
"*": [

modules/network/wifi/manifest.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
]
3838
}
3939
},
40+
"linemb": {
41+
"modules": {
42+
"*": [
43+
"$(MODULES)/network/wifi/sim/*"
44+
]
45+
}
46+
},
4047
"mac": {
4148
"modules": {
4249
"*": [

0 commit comments

Comments
 (0)