Posts by fs-support_HK

    Quote from "jmata"

    Would I only need this class to make it work? I mean put the CanPort class as another class in my project, and call it from my code.


    Exactly. Just import the class into your project and use it. That's all.


    Regards,


    H. Keller

    Just to clarify: each pin is configured as either INPUT or OUTPUT via the registry. This configuration is activated during start-up. Therefore you can configure the pin as input or output at will, but the meaning can only change by restarting the NetDCU. Switching the meaning from input to output or from output to input at runtime is not possible. This is a restriction by the WinCE DIO driver, not by the hardware (under Linux, switching between input and output at runtime is in fact possible).


    However on an OUTPUT pin, you can read back the active value anytime later. So for example when one application writes high, then later the other application can read the pin and will see the high value that is driven to the line.


    Regards,


    H. Keller

    Probably the transmit line from your PC to the NetDCU does not work.


    Try to connect this cable to the other COM port where NDCUCFG is running. If you can enter text there, the cable works. Otherwise your cable might be damaged, try a different one.


    Regards,


    H. Keller

    Ein eigener Thread, der einfach nur ReadFile() aufruft, braucht ebenfalls keine "dauernde" Abfrage. The Funktion blockiert und kehrt somit erst zurück, wenn entsprechend Zeichen empfangen wurden. Durch Setzen der entsprechenden Read-Timeouts mit SetCommTimeouts() kann man erreichen, dass ReadFile() beim ersten empfangenen Zeichen sofort zurückkehrt, so dass unmittelbar innerhalb des Threads darauf reagiert werden kann.


    H. Keller

    We have a C# class to access the CAN port. I think this can rather easily be combined with a VB program. However this software is not for free. Please contact our sales department.


    Regards,


    H. Keller

    The set of WinCE Remote Tools already contains the "Remote Process Viewer". By starting this tool on your PC, you can view all processes and threads running on your board and you can also kill the processes. I guess most people will use this tool.


    The Remote Tools are installed with Embedded Visual C++ (Menu Tools inside the program) or with Visual Studio (Program -> Visual tudio 2005 -> Remote Tools).


    However you are right, there is no such tool to be run on the NetDCU itself. Therefore thanks for providing this program.


    Regards,


    H. Keller

    Quote from "joL"

    i wonder if nobody uses SSL or if everybody just thinks i should not ask such stupid questions....well just one link to makecert.exe would have saved me from a real graet day :-)


    I think SSL is already rather high level stuff where not everybody can help anymore. Maybe nobody here on the list actually did all these steps before and knew that part with makecert.exe... For example I have to admit it was new for me. But I'm no expert on encryption and secure transmissions anyway.


    Best regards,


    H. Keller

    There seems to be some inconsistency here: Pin 10 on Connector J5 (J5.10) is controlled by Bit 3 on Port 1 (Port 1.3), not Bit 0 as you assumed.


    Regards,


    H. Keller

    Unfortunately the driver does not support such a feature directly. But you can use some GPIO lines to switch between different SPI slave devices. For example by using two GPIO lines and a 2:4 address decoder, you can switch between 4 devices.


    Please note that all devices must be capable of using the same SPI mode (trigger edge), as with the current driver this value is predefined in the registry and can not be changed at runtime.


    Regards,


    H. Keller

    These are the supported SPI speeds of NetDCU5.2 and NetDCU8:


    Code
    1. Board Base Frequency Dividers Min. Frequency Max. Frequency
    2. ----------------------------------------------------------------------
    3. NetDCU5.2 1.84 MHz 1 to 256 7.2 kHz 1.84 MHz
    4. NetDCU8 25.5 MHz 1 to 256 99.6 kHz 25.5 MHz


    Please note that the Native SPI driver is not included in the Starter Kit and has to be purchased seperately.


    Regards,


    H. Keller

    The default value already uses the slowest possible speed.


    Nevertheless here is the definition:



    Regards,


    H. Keller

    Quote from "auie"

    I have an example but not working.
    ...
    What is my problem?


    What does "not working" mean? You don't see any values on one of the corresponding pins? Please note that with this program you can only find signals on the pins 2 to 9 of connector J5. Which pin are you checking?


    As you don't have any delays included, the values will arrive very fast, and you can only see them with an oszilloscope.


    Regards,


    H. Keller

    You can do both: use TFAT to reduce failure of the file system in general. (This alone will *not* avoid data loss of non-yet written files.) If you add the "three partition" solution then you avoid loosing data at all. And it is easier to recover from the rare cases when even TFAT fails.


    TFAT *is* rather secure as it uses the two FATs as a kind of simple journal. But while doing this, it often has to write to the boot sector, especially the "File System Valid" flag to mark if the file system is consistent (transaction complete) or if it is currently changing the content (transaction in progress). This procedure may fail in those cases when the writing of the boot sector is unexpectedly interrupted.


    Quote

    but I would have expected that a dedicated flash file system could withstand power loss during write ...


    That was my first thought a few years ago, too. However if you dive a little deeper into the file systems, you will see getting a really failsafe file system is not easy at all. If you look at jffs2, yaffs or whatever "failsafe" flash file systems there may be, even in the linux world, they all can (and will) fail in certain circumstances. It is always a compromise between memory requirements, efficency and average failure probabilities. So nothing different with NetDCU and FAT/TFAT there...


    BTW we *are* currently developing a new file system offering more security. But this is still work in progress.


    Regards,


    H. Keller

    The whole topic is rather complicated. Even if using TFAT, there is a small risk of getting an inconsistent file system. Most of the "secure" file systems silently assume that writing a page or block is atomic, i.e. always succeeds in whole or fails in whole. But if the power is switched off exactly while writing is active, the result is indetermined. The only thing a more secure file system can do is reduce the time while the disk is inconsistent. But you can almost never bring this time to zero.


    Moreover all these file systems only provide a consistent file system at the next start. This is usually done by using a journal that can reconstruct the file system in an instant, or by issuing a file system check at startup. However this does not mean that you don't loose data that was still in the memory buffer when the power failed.


    In fact I don't know of any really transaction-save, lossless file system. Therefore the idea must be to reduce the risk of loosing data by other techniques.


    1. By using different partitions for read-only data like program executables and for the changeable data. Then the important read-only data is never in danger.


    2. By avoiding times when data is only held in volatile memory before actually been written to the non-volatile media. For example use fflush() in your software or close the files as soon as possible. Or use FILE_FLAG_WRITE_THROUGH in CreateFile(). Or use _flushall() to sync all the files.


    Quote from "Behrenbeck"

    a) is a partition really (!) safe as long as there is no write command issued to it ?


    I would assume yes. The system does not create any temporary files under FFSDISK and it opens executables in read-only mode.

    Quote

    I did not find a mount read only flag like linux has


    However there is. You can set PARTITION_ATTRIBUTE_READONLY with SetPartitionAttributes() before mounting the partition.


    Quote

    b) how can I make a partition unusable to create test cases ?


    Just do all the things that usually bring the trouble: heavily write on the partition and then switch off the power. Either after some iterations, the file system is actually damaged, or it proves that it is more stable than assumed.


    Quote

    How does CE react if there is a bad partition? does it continue quickly with booting ?


    Usually yes. At least as long the files required during the boot process are not damaged. However it is rather dangerous to write to an inconsistent file system as this may corrupt further data.


    Regards,


    H. Keller

    I have just added a sample in VB.NET of how to access NI2C. Please have a look if this can help you. Maybe you can even take this class, generate a DLL from it and use it directly from C#. However this is not fully tested and may still contain some errors. But it may serve as a steppingstone for your own implementation.


    Regards,


    H. Keller