This has been mentioned several times before in various forms: It would be really nice if you were able to upload/deploy native code along with your managed code. Perhaps even with standard P/Invokes etc. "Custom Native code" is a necessary evil when the managed code isn't jit compiled. (Which is fine.)
If you want to add native code today, you have to recompile the whole netmf source and reflash it. This presents several problems:
- Reflashing the tinyclr is not always easy. And it varies from platform to platform. (This might have been adressed in netmf 4.2 already though. Fw updates.)
- Compiling the netmf is not always easy.
- A lot of companies doesn't give out their distribution of the netmf. (Hence you can't compile it.)
- Compiling with free or low cost native compilers will often yield bigger and slower results than the company compiles. As an example you can take a look at the Netduino boards from Secret labs. Add TCP/IP to the tinyclr and the resulting compile won't fit. The RVDS compile from Secret Labs will however.
This leads to the next point. If you could upload native code, you would be able to break up the tinyclr into several compile images. This would mean the world to small resourced boards like eg. the USBizi boards from GHI and the Netduino boards from Secret Labs. (And the netmf is meant to be small right?) Today when you add a reference to eg. Microsoft.SPOT.Hardware.SerialPort to your project. You're not really adding anything but a "managed header". The actual (native) code is already compiled into tinyclr and is already on the board. The tinyclr could be much smaller if it didn't contain everything. And the netmf could become much bigger if it didn't have to worry too much about the tinyclr size. Eg. if you could add just the right (few) amount of references, in each of your projects, it wouldn't matter if the whole netmf didn't fit on the board.
This would also improve the PK. With a smaller tinyclr it would be easier to make a new port. (Or perhaps just faster.) You would only have to fokus on the basics. All the extra stuff like drivers and nice-to-have could then be developed later and/or by the community.