From: Stefan R. <st...@s5...> - 2009-09-10 17:49:33
|
Alaney Dória wrote: > I'm trying to write to configuration rom using the following code but > does not work > > value = CSR1212_CPU_TO_BE32(value); > result = m_ieee1394Service->write(m_nodeId, > m_nodeControllerBaseAddress | NCS_IDENTIFY, 1,&value); > > the value: > m_nodeControllerBaseAddress = 0xffffe0001140 > #define NCS_IDENTIFY 0x10 To be precise, you aren't writing to the Configuration ROM but to a application-specific location in the so-called private space. Configuration ROM is a read-only register from 0xffff,f000,0400 inclusive to 0xffff,f000,0800 exclusive. > digging the code I found this > > Ieee1394Service::writeNoLock( fb_nodeid_t nodeId, > fb_nodeaddr_t addr, > size_t length, > fb_quadlet_t* data ) > { > if (nodeId == INVALID_NODE_ID) { > debugWarning("operation on invalid node\n"); > return false; > } > > #ifdef DEBUG > debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"write: node 0x%hX, addr = > 0x%016llX, length = %d\n", > nodeId, addr, length); > printBuffer( DEBUG_LEVEL_VERY_VERBOSE, length, data ); > #endif > > return raw1394_write( m_handle, nodeId, addr, length*4, data ) == 0; > <- any reason for this? > } Reason for what? The comparison with 0 is a check for success. > What I would like to know if there is anything I'm doing wrong. Can you further qualify "does not work"? If raw1394_write fails, an errno is set. Which errno means what isn't documented, but we have the source of the software stack... Furthermore, if there aren't complex requirements on device state/ protocol sequence, you can also unit-test with gscanbus (can perform quadlet write requests, quadlet read requests, and block read requests) or firecontrol (can perform any read, write, or lock requests and more). (By the way, libraw1394's asynchronous API, i.e. raw1394_write() and friends is seriously flawed. (a) applications are forced to track node IDs, yet (b) applications cannot specify to libraw1394 in which bus generation the node ID is valid. A node ID is pretty much meaningless, only a node ID : generation tuple makes sense; but in most cases, applications would be better served by a higher level API which hides the node ID.) -- Stefan Richter -=====-==--= =--= -=-=- http://arcgraph.de/sr/ |