Skip to content
Snippets Groups Projects
Commit 12143ba3 authored by Florian Pose's avatar Florian Pose
Browse files

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

parent 8ed78d37
No related branches found
No related tags found
No related merge requests found
...@@ -103,21 +103,21 @@ int ecrt_slave_sdo_read(ec_slave_t *slave, /**< EtherCAT-Slave */ ...@@ -103,21 +103,21 @@ int ecrt_slave_sdo_read(ec_slave_t *slave, /**< EtherCAT-Slave */
uint32_t *value /**< Speicher fr gel. Wert */ uint32_t *value /**< Speicher fr gel. Wert */
) )
{ {
uint8_t data[0x0A]; uint8_t data[0x20];
size_t rec_size; size_t rec_size;
EC_WRITE_U16(data, 0x2000); // Number (0), Service (SDO request) EC_WRITE_U16(data, 0x2000); // Number (0), Service = SDO request
EC_WRITE_U8 (data + 2, 0x1 << 1 | 0x2 << 5); // Exp., Upload request EC_WRITE_U8 (data + 2, 0x1 << 1 | 0x2 << 5); // Expedited upload request
EC_WRITE_U16(data + 3, sdo_index); EC_WRITE_U16(data + 3, sdo_index);
EC_WRITE_U8 (data + 5, sdo_subindex); EC_WRITE_U8 (data + 5, sdo_subindex);
if (ec_slave_mailbox_send(slave, 0x03, data, 6)) return -1; 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_slave_mailbox_receive(slave, 0x03, data, &rec_size)) return -1;
if (EC_READ_U16(data ) >> 12 == 0x02 && // SDO request if (EC_READ_U16(data) >> 12 == 0x02 && // SDO request
EC_READ_U8 (data + 2) >> 5 == 0x04) { // Abort SDO transf. req. EC_READ_U8 (data + 2) >> 5 == 0x04) { // Abort SDO transfer request
EC_ERR("SDO upload of 0x%04X:%X aborted on slave %i.\n", EC_ERR("SDO upload of 0x%04X:%X aborted on slave %i.\n",
sdo_index, sdo_subindex, slave->ring_position); sdo_index, sdo_subindex, slave->ring_position);
ec_canopen_abort_msg(EC_READ_U32(data + 6)); ec_canopen_abort_msg(EC_READ_U32(data + 6));
......
...@@ -225,7 +225,7 @@ int __init init_rt_module(void) ...@@ -225,7 +225,7 @@ int __init init_rt_module(void)
//ecrt_master_debug(master, 0); //ecrt_master_debug(master, 0);
#if 0 #if 1
if (ecrt_master_sdo_read(master, "1", 0x100A, 1, &version)) { if (ecrt_master_sdo_read(master, "1", 0x100A, 1, &version)) {
printk(KERN_ERR "Could not read SSI version!\n"); printk(KERN_ERR "Could not read SSI version!\n");
goto out_deactivate; goto out_deactivate;
...@@ -233,7 +233,7 @@ int __init init_rt_module(void) ...@@ -233,7 +233,7 @@ int __init init_rt_module(void)
printk(KERN_INFO "Software-version: %u\n", version); printk(KERN_INFO "Software-version: %u\n", version);
#endif #endif
#if 0 #if 1
if (ecrt_master_sdo_write(master, "1", 0x4061, 1, 0, 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, 2, 1, 1) ||
ecrt_master_sdo_write(master, "1", 0x4061, 3, 1, 1) || ecrt_master_sdo_write(master, "1", 0x4061, 3, 1, 1) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment