Bugfix: Größerer Puffer für CoE-Daten beim SDO upload.

This commit is contained in:
Florian Pose 2006-03-28 12:38:05 +00:00
parent 9ae1bdf63e
commit 173d70ba3c
2 changed files with 8 additions and 8 deletions

View File

@ -103,21 +103,21 @@ int ecrt_slave_sdo_read(ec_slave_t *slave, /**< EtherCAT-Slave */
uint32_t *value /**< Speicher für gel. Wert */
)
{
uint8_t data[0x0A];
uint8_t data[0x20];
size_t rec_size;
EC_WRITE_U16(data, 0x2000); // Number (0), Service (SDO request)
EC_WRITE_U8 (data + 2, 0x1 << 1 | 0x2 << 5); // Exp., Upload request
EC_WRITE_U16(data, 0x2000); // Number (0), Service = SDO request
EC_WRITE_U8 (data + 2, 0x1 << 1 | 0x2 << 5); // Expedited upload request
EC_WRITE_U16(data + 3, sdo_index);
EC_WRITE_U8 (data + 5, sdo_subindex);
if (ec_slave_mailbox_send(slave, 0x03, data, 6)) return -1;
rec_size = 6;
rec_size = 0x20;
if (ec_slave_mailbox_receive(slave, 0x03, data, &rec_size)) return -1;
if (EC_READ_U16(data ) >> 12 == 0x02 && // SDO request
EC_READ_U8 (data + 2) >> 5 == 0x04) { // Abort SDO transf. req.
if (EC_READ_U16(data) >> 12 == 0x02 && // SDO request
EC_READ_U8 (data + 2) >> 5 == 0x04) { // Abort SDO transfer request
EC_ERR("SDO upload of 0x%04X:%X aborted on slave %i.\n",
sdo_index, sdo_subindex, slave->ring_position);
ec_canopen_abort_msg(EC_READ_U32(data + 6));

View File

@ -225,7 +225,7 @@ int __init init_rt_module(void)
//ecrt_master_debug(master, 0);
#if 0
#if 1
if (ecrt_master_sdo_read(master, "1", 0x100A, 1, &version)) {
printk(KERN_ERR "Could not read SSI version!\n");
goto out_deactivate;
@ -233,7 +233,7 @@ int __init init_rt_module(void)
printk(KERN_INFO "Software-version: %u\n", version);
#endif
#if 0
#if 1
if (ecrt_master_sdo_write(master, "1", 0x4061, 1, 0, 1) ||
ecrt_master_sdo_write(master, "1", 0x4061, 2, 1, 1) ||
ecrt_master_sdo_write(master, "1", 0x4061, 3, 1, 1) ||