In our case, we have two SPI devices on our board so I need two select lines. How can I tell (is there really no documentation??) the NspiPort what pins to use?
Posts by dhovden
-
-
another question: I2cdevaddr, what should that be? I think that the default in the registry hex 70 was, is that ok?
-
I can't find a file with registry settings for ETM070080ADH6, can you send me one or post it here?
I'm now using defaults and think that that may be the reason for the problems I have -
OK, thank you. But that still doesn't explain why nspi.Receive doesn't work does it?
-
Please F&S, I'm not getting any reactions on this issue nor on the NativeSPI problem:
* Why doesn't the touch screen driver load?
* Why doesn't nspi.Receive work?
-
Please F&S, I'm not getting any reactions on this issue nor on the touch screen problem:
* Why doesn't nspi.Receive work?
* Why doesn't the touch screen driver load?
-
It seems the ReadMemory, or better said, the nspi.Receive doesn't work properly:
int ires=nspi.Receive(command, out data, count);
where command is MEM_READ,0,0 and count is 32
What I get is this output from the application:
I check the return code of Receive and if it's not 0 (and it isn't, Receive seems to return the value of 'count') I call GetLastError.
The fact the Receive returns the count makes me think it isn't an error but why then do I get an error code from GetLastError?87 is ERROR_INVALID_PARAMETER but which one, there are only three. Unless the error happens in Receive itself.
Again the problem is lack of documentation - I have no up to date documentation telling me how to use a v3.0 NspiPortSo what goes wrong?
And, by the way, what should nspi.SpiMode and nspi.ClockFreq be set to?
-
True enough but I think that "sample code" should at least work, otherwise it's not a good template.
And I can test and debug and measure but it's not easy when the documentation tells you the wrong thing.And yes, I do appreciate that your platform is flexible and therefore complex, it's just frustating when the days go by waiting for solutions.
And yes, your support is mostly good
-
OK, I thought POLLING was default - I have changed that and now it seems to work so I'm reasonably happy.
The fact remains though that you ask 500 euro for a software package that* comes with no documentation
* the documentation on your site is incorrect: it says "The easiest way to install the driver is to use the provided
Windows Cabinet File nspi.cab." and it says to set DriverMethod to 0* comes with incorrect sample code that can never work
That is not impressive! It has also beomce my experience of F&S: when things work they work well but nothing (or little) works straight away.
Some recent examples: NativeSPI, serial driver, capacitive touch screenTwo of these have now been solved (it seems) but the touch screen still doesn't work ...
-
And I still get the same exception error at nspi.Receive, in the first call to ReadMem, reading 100 bytes from address 0:
-
I see "UART: Version 1.5", is that correct?
-
I have asked our hardware man and we do have external pullups. I have changed the setting of IntPullUp back to 0 but I still get the error message although now it says
I2C_Readregister: message failed (flags=8)
i.e. flags=8 instead of flags=4
I have disabled CAN1 and CAN2 but that didn't change anything.
Anything else to try??
-
"pullups not available" - I have set
HKLM\Drivers\BuiltIn\PicoCOMA5\I2C1_V120, IntPullUp to 1 (NI2C: IntPullUp = 0x00000001 = 1)
"configured I2C device is wrong"
* Device is I2C1 (TCH: I2CDevice =I2C1:)
"one of the lines used by other driver"
are we talking the DATA and the CLK lines here or also the IRQ and RST lines? The latter two looks ok
TCH: Change-IRQ configured on IO-Pin 40
TCH: Reset-line configured on IO-Pin 35For DATA and CLK we use 32 and 33 (SDA and SCL) but from the I/O pin map I see that those pins are also used by CANRX1/TX1. Do I need to disable CAN and if so, how?
-
Please ignore the previous post for now (although I still at some point would want to know what all the ASTADPEDT1 stuff is), I managed after several reboots to get into EBoot and did Restore registry after which the PicoCom again worked (and again had the weird ASTADPEDT1 setting and the strange Mode6 and Mode19 entries under Display\LCD)
The most important thing right, and what I would really like an answer to, is this
i.e. why isn't the touch screen controller working?
-
In an attempt to get further with the touch problem I deleted all the entries in registry key Drivers\Display\LCD (except the defined modes. e.g mode19). The values deleted were
Code- REG_SZ Default (value not set)
- REG_DWORD VidMemBase 8f000000
- REG_DWORD UseBootInit 0
- REG_DWORD XMemBase 0
- REG_DWORD XMemLen 0
- REG_SZ DisplayDll display.dll
- REG_DWORD MemBase 40058000
- REG_DWORD MemLen 5000
- REG_DWORD PrimaryWin 2
- REG_DWORD DDOverlayWin 1
- REG_DWORD OESWin 0
- REG_DWORD OESFlip 0
- REG_SZ UseAsPost CAM1:
- REG_SZ UseForWB CAM3:
- REG_DWORD BlendPolicy 1
- REG_DWORD PresetColorkeyPrimaryWin 8
- REG_DWORD PresetColorkeyDDOverlayWin 8
- REG_SZ ExtDll ASTADPEDT1.dll
- REG_SZ PWMDevice AstADPEP1
Because I don't recognise ASTADPEDT1 at all I thought this was unused stuff (the debug log told me that loading ASTADPEDT1 failed anyway), hence the delete.
I expected the PicoComA5 to start up with the default screen, ET0700 something but it didn't.Instead it has gone in to some kind of self-test mode, showing the basic colours and some patterns and it reacts to nothing. I can only enter NBoot mode and that doesn't help any. There seems to be no way to reach the registry, I can't event download a new kernel - how do I get back control of the PicoCom??
-
To avoid struggling with PInvoke and loads of IOCTL, we have purchased the SKIT-VS.NET package. Before I describe the problem I have I need to complain a bit first:
1) The kit is delivered as one zip file with absolutely no documentation for SPI, only the DLL and sample code
2) All SPI docs on the F&S site refer to 'Native SPI' it isn't easy to know what is what
3) The most recent document I have found is <!-- m --><a class="postlink" href="http://www.fs-net.de/download/docu/common/english/NetDCU_NSPI_DOTNET_eng.pdf">http://www.fs-net.de/download/docu/comm ... ET_eng.pdf</a><!-- m -->
It documents "Native SPI V1" and describes NspiPortV1, something which doesn't exist in the current NativeSPI.dll4) The most recent SPI document is called "Native SPI support" and is from 2013-03-13 but describes interfacing with SPI through CreateFile, ReadFile etc, i.e. using the standard nspi.dll - but again that word "Native"
5) The document at NetDCU_NSPI_DOTNET_eng.pdf says "The easiest way to install the driver is to use the provided Windows Cabinet File nspi.cab". Sounds good but there is no such file included with the SKIT-VS.NET package - installation must be done by hand - not impressive considering the package costs euro 500 ...
Anyway, I have done the install and loaded the sample code, fm25cl64. I upgraded the project to use CF3.5 instead of CF2 and then pressed F5, Start debugging.
The program is built and deployed and runs and then goes bang at nspi.Receive(command, out data, count):Code- A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in NativeSPI.dll
- System.ComponentModel.Win32Exception was unhandled
- Message="Error 1 in IOCTL_NSPI_RECEIVE"
- ErrorCode=-2147467259
- NativeErrorCode=1
- StackTrace:
- at FS.NetDCU.NspiPort.CheckWin32Error()
- at FS.NetDCU.NspiPort.WaitirqReceive()
- at FS.NetDCU.NspiPort.Receive()
- at FS.NetDCU.Program.ReadMem()
- at FS.NetDCU.Program.Main()
- InnerException:
The debug output doesn't add much:
NSPI: Controller 0, SPI_IOControl(): Transmission error (Error 1)
Now, and I don't know if this is important, I don't actually have a FM25CL64 on my board. Instead I have a Microchip 25LC256 - almost but not quite the same although all addresses (READ, WRITE, WREN etc are the same as in the code sample). But can this be the problem?
If the hardware isn't the problem, what is?
Here is what the registry for SPI1 looks like (according to page of the docs)
Code- REG_SZ Dll FS_NSPI.dll
- REG_DWORD Debug ff
- REG_DWORD RxChannel 4
- REG_DWORD TxChannel 3
- REG_DWORD DriverMethod 0
- REG_DWORD Priority256 67
- REG_DWORD SPIMode 0
- REG_DWORD ClockFreq 30d40
- REG_SZ Prefix SPI
- REG_DWORD Order 65
- REG_DWORD Index 1
- REG_DWORD CsPin 29
- REG_SZ FriendlyName Native SPI driver
- REG_DWORD DeviceArrayIndex 0
Nothing seems to work lately on the PicoComA5: serial comms (e.g RTS), capacitive touch screen and now SPI
-
How do I install the new fs_serial.dll? I can't copy, Windows tells me I'm not allowed.
-
OK, I have added Debug and set it to 255, result:
Code- Microsoft Windows CE Bootloader Common Library Version 1.1 Built Nov 26 2013 15:18:27
- Microsoft Windows CE Bootloader for PicoCOMA5 Built Nov 29 2013
- Portions copyright (c) 2012 F&S Elektronik Systeme GmbH
- Boot Loader, Version 0.6
- NBoot, Version
- HW rev. 1.20
- HW-Watchdog: ON
- System ready!
- Preparing for download...
- Press >S< to step into monitor...
- AUTO BOOT enabled
- Kernel (35131kB) read from flash disk started finished in 4066 milliseconds
- INFO: OEMLaunch: Jumping to Physical Address 0x8010AD4Ch (Virtual Address 0x0h)...
- Jumping to Kernel @ 0x8010AD4C
- Windows CE Kernel for ARM (Thumb Enabled) Built on Mar 8 2013 at 17:05:33
- INFO:OALLogSetZones: dpCurSettings.ulZoneMask: 0xb
- OAL Log enable : 1
- OAL Log mask : 3
- pInfo->L2Base=0x40006000 g_vaL2CtrlBase=0xb0006000
- A
- pl310_assoc_index=0x8 pl310_way_index=0x3 pl310_line_index=0x0
- B
- C=0x0
- D=0x8
- E
- 1
- X1
- X2
- 2
- 0x82387960
- 0x50
- OAL_IntrInit: TODO
- +OALTimerInit(1 131 0)
- g_pGPC PA=0x4006c000 VA = 0xb006c000
- g_pGPC->LPMR=0x0
- g_pGPC->PGSR=0x0
- g_pCCM->CLPCR=0x78
- cmp=0x83
- PicoCOMA5 V1.03 - Firmware Init
- Copyright (c) 2013 F&S Elektronik Systeme GmbH
- Build: Dec 4 2013/12:56:15
- FMD: g_pNFConReg=0xb00e0000 --> FMD: NAND ID:0x2cf18095 --> MICRON: 1GBit (128MB)
- FMD: Block 0 to 12 are locked for boot loader
- OAL: CPACR=0xf00000 NSACR=0xc00
- ========
- CPU Info
- ========
- CPU ID 0xc05
- CPU Revision 0x0 0x1
- Total CPUs 1
- SMP is supported 1
- THUMB is supported 4
- JAZELLE is supported 1
- VFP is supported 1
- UTLB is supported 1
- Maintenance broadcast 2
- Pvt timer freq in MHz 66
- =========
- Plat Info
- =========
- Board is RTSM 0
- L2 is extern 1
- Periph Base 0x40002000
- SCU Base 0x40002000
- ==========
- Cache Info
- ==========
- L1 I Sets 512
- L1 I Ways 2
- L1 I Line Sz 32
- L1 I Sz 32768
- L1 D Sets 256
- L1 D Ways 4
- L1 D Line Sz 32
- L1 D Sz 32768
- L2 Sets 2048
- L2 Ways 8
- L2 Line Sz 32
- L2 Sz 524288
- =========
- Overrides
- =========
- ====================
- Enable SCU
- WARNING: No external rtc found!.
- cBoardConfig.chFeatures1=0x10 16 chBoardType=0x1
- [OAL] RestartReason: Software
- FMD: g_pNFConReg=0xd0330000 --> FMD: NAND ID:0x2cf18095 --> MICRON: 1GBit (128MB)
- FMD: Block 0 to 12 are locked for boot loader
- PM-NETDCU: STARTED
- BE2: Version 1.3, ActiveKey = Drivers\Active\01
- PSS: Version 1.1, ActiveKey = Drivers\Active\07
- InitializeTransceiver: IRQ=108, sysIntr=18
- NI2C: Version 0.6, ActiveKey = Drivers\Active\12
- ENET: Version 01.00, ActiveKey = Comm\ETHNETA
- UsbHost : New Function [address(1) / layer(0)]
- ENET: Version 01.00, ActiveKey = Comm\ETHNETB
- Attach moutouchHID
- TCH: Version 0.5, ActiveKey = Drivers\Active\17
- TCH: Touch Driver attached, Version 0.5
- BE2: Version 1.3, ActiveKey = Drivers\Active\18
- NI2C: Version 0.6, ActiveKey = Drivers\Active\19
- NI2C: Priority256 = 0x00000067 = 103 (Default)
- NI2C: ClockFreq = 0x00030d40 = 200000
- NI2C: DeviceArrayIndex = 0x00000001 = 1
- NI2C: IntPullUp = 0x00000001 = 1
- NI2C: DrvStrength = 0xffffffff = 4294967295 (Default)
- NI2C: RepeatedStarts = 0x00000001 = 1
- NI2C: -GetRegistryData()
- NI2C1: I2C_Init: MUX Pad Control Register[38]=0x00000001
- NI2C1: I2C_Init: MUX Pad Control Register[39]=0x00000001
- UART: Version 1.5, Key = Drivers\Active\20
- UART: Version 1.5, Key = Drivers\Active\21
- UART: Port disabled. Serial debug is on !
- AIN: Version 1.1, ActiveKey = Drivers\Active\23
- PWM: Version 1.2, ActiveKey = Drivers\Active\24
- I2C: Version 4.2, ActiveKey = Drivers\Active\25
- WAV: Version 2.3, ActiveKey = Drivers\Active\26
- BCS: Version 1.3, ActiveKey = Drivers\Active\40
- NSPI: Version 3.0, ActiveKey = Drivers\Active\43
- DIO: Version 2.8, ActiveKey = Drivers\Active\44
- EXTRTC: Version 1.1, ActiveKey = Drivers\Active\45
- NI2C3: +I2C_Open()
- NI2C3: [6320] 0xd2fb0ca0: Device opened
- NI2C3: -I2C_Open()
- EXTRTC: No external RTC detected
- NI2C: +I2C_Close(0xd2fb0ca0)
- NI2C: -I2C_Close()
- LCD: Version 1.4, ActiveKey = Drivers\Display\LCD
- LCD: Read registry settings from Drivers\Display\LCD
- NI2C3: +I2C_Open()
- NI2C3: [6421] 0xd2fb3980: Device opened
- NI2C3: -I2C_Open()
- LCD: ASTADPEDT1.dll - Init failed
- LCD: Could not intialize external PWM device AstADPEP1 (LE:2)
- LCD: Display-Mode 6, Name ET070080
- TCH: Debug =0xff
- TCH: I2CDevAddr =0x70
- TCH: ChangeIO =0x28
- TCH: ResetIO =0x23
- TCH: WakeIO =0x0
- TCH: ChangeIOFunction =0x0
- TCH: LogFile =
- TCH: I2CDevice =I2C1:
- TCH: LogFileDebug =0x0
- TCH: LogFileTruncate =0x1
- TCH: InvertX =0x0
- TCH: InvertY =0x0
- TCH: SWCalibration =0x0
- NI2C1: +I2C_Open()
- NI2C1: [6684] 0xd2fba4e0: Device opened
- NI2C1: -I2C_Open()
- TCH: Change-IRQ configured on IO-Pin 40
- TCH: Reset-line configured on IO-Pin 35
- TCH: Interrupt registered successfully (IRQ=265, SYSINTR=26)
- I2CLIB: I2C_ReadRegister(): Message failed (flags=4)
- TCH: EnableTouchScreen(): get firmware version failed
- Cannot initialize the touch screen controller.
- TCH: Driver Failed to Init.
- TCH: Could not enable touch panel
- NDCUCFG V 55 started. Platform: PicoCOMA
- NDCUCFG Open COM1: at 38400 Baud
- CreateFile() failed -> ERROR COM1:
- CheckAutoStart: Version 1.6, LaunchNum = 100
This doesn't look goodWhat firmware version are we talking about?
This also may be a problem: LCD: Display-Mode 6, Name ET070080 because that's not really the screen, only almost.
Do I need an exact mode definition for the ETM070001ADH6 in the registry perhaps? Can I find that on your site? -
Still no touch!!
Registry looks like this
Code- HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Touch_EDT
- REG_DWORD ChangeIO 28
- REG_DWORD ResetIO 23
- REG_SZ I2CDevice I2C1:
- REG_DWORD Flags 8
- REG_SZ Prefix TCH
- REG_SZ Dll fs_touch_edt.dll
- REG_DWORD Order 20
- REG_DWORD Index 3
- REG_MULTI_SZ IClass {25121442-08CA-48dd-91CC-BFC9F790027C};{A32942B7-920C-486b-B0E6-92A702A99B35}
- REG_DWORD Priority256 6d
- REG_DWORD SysIntr 0
- REG_DWORD InitialSamplesDropped 2
- REG_DWORD SampleRate c8
- REG_DWORD I2CDevAddr 70
- REG_SZ LoadAsyncEvent SYSTEM/ShellAPIReady
- REG_DWORD WakeIO 0
- REG_DWORD ChangeIOFunction 0
- HKEY_LOCAL_MACHINE\Drivers\BuiltIn\DIGITALIO
- REG_BINARY UseAsIO 04 00 01 00 00 c0 01
- REG_BINARY DataDir 04 00 01 00 00 c0 01
- REG_BINARY DataInit 00 00 01 00 00 00 01
- REG_SZ Prefix DIO
- REG_SZ Dll FS_DIGIO.DLL
- REG_DWORD Order 97
- REG_DWORD Index 1
- REG_DWORD Ioctl 4
- REG_DWORD Port 0
- REG_SZ FriendlyName Digital I/O driver for Vybrid
- REG_DWORD Debug 0
- HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PicoCOMA5\I2C1_V120
- REG_SZ Default (value not set)
- REG_DWORD IntPullUp 1
- REG_SZ Prefix I2C
- REG_SZ Dll fs_ni2c.dll
- REG_DWORD Order 19
- REG_DWORD Index 1
- REG_DWORD DeviceArrayIndex 1
- REG_DWORD BoardRevision 78
- REG_SZ FriendlyName Native I2C driver feature con.
- REG_DWORD ClockFreq 30d40
- REG_DWORD RepeatedStarts 1
Please note: ChangeIO=28 and ResetIO=23 is in hex, WinCE Remote Registry Editor says 40 and 35.
So the pins used are 32, 33, 35 and 40.Any idea why it doesn't works? And why don't we see some activity on pins 32 and 33?
-
We are using 35 for Reset and 40 for IRQ now. If I want to specify 40 in the registry, I can enter that as just decimal 40 or hex 0x28, is that correct?
Reason I ask this is because in the device map for fs_touch_edt.dll (fs_touch_edt.txt), it says 0x56 and 0x57 which is strange because those pins don't even exist And decimal 56 and 57 are LCD pins. Confusing ....
In your example, you use 41 and 40 but there's no reason why 40 and 35 shouldn't work? (SD/MMC has been disabled)
Also, pin 41 is PWM, can that be used for other purposes?Do I need to set the UseAsIO, DataDir etc registry entries etc for the RST and IRQ pins? Or does fs_touch_edt.dll do that for me?
The PicoComA5 board is rev 1.22 (2013).
From the documentation for the touch controller, it looks like, at startup, the RST line should be pulled briefly low so it should be set to initially be high - correct? Then the controller will react with an IRQ - does the PicoCom check for that IRQ before it does anything else on the touch interface?
Next, CLK must be set high to select I2C and after that everything should work. But our CLK is high (pin 33) so I2C should be selected but we see no activity on the pins 32 and 33 when the screen is touched.